Omitted MS rebar option.

This commit is contained in:
Gerald Schmidt 2007-09-28 20:32:49 +00:00
parent f33649c76f
commit d1c008912d
9 changed files with 24 additions and 399 deletions

View File

@ -1,52 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wxCoolBar
// Purpose: header of wxCoolBar an related classes for wxMSW
// Author: Martin Simon
// Modified by:
// Copyright: (c) Martin Simon - martin.simon@planet-berlin-it.de
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
WXWINDOWS LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxWindows Library Licence, applying
either version 3.1 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version
3.1 of the Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under your own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.

View File

@ -1,35 +0,0 @@
/*
* Copyright 2005-2007 Gerald Schmidt.
*
* This file is part of Xml Copy Editor.
*
* Xml Copy Editor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* Xml Copy Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xml Copy Editor; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//mymenubar.cpp
#include "mymenubar.h"
BEGIN_EVENT_TABLE ( MyMenuBar, wxMenuBar )
END_EVENT_TABLE()
MyMenuBar::MyMenuBar ( long style ) : wxMenuBar ( style )
{
#ifdef __WXMSW__
wxWindow *window = ( wxWindow * ) this;
HWND handle = ( HWND ) window->GetHandle();
if ( !handle )
return;
#endif
}

View File

@ -1,36 +0,0 @@
/*
* Copyright 2005-2007 Gerald Schmidt.
*
* This file is part of Xml Copy Editor.
*
* Xml Copy Editor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* Xml Copy Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xml Copy Editor; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// mymenubar.h
#ifndef MY_MENU_BAR
#define MY_MENU_BAR
#include <wx/wx.h>
#include <wx/dcbuffer.h>
class MyMenuBar : public wxMenuBar
{
public:
MyMenuBar ( long style = 0 );
private:
DECLARE_EVENT_TABLE()
};
#endif

View File

@ -1,112 +0,0 @@
/*
* Copyright 2005-2007 Gerald Schmidt.
*
* This file is part of Xml Copy Editor.
*
* Xml Copy Editor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* Xml Copy Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xml Copy Editor; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//mytoolbar.cpp
#include "mytoolbar.h"
BEGIN_EVENT_TABLE ( MyToolBar, wxToolBar )
EVT_ERASE_BACKGROUND ( MyToolBar::OnEraseBG )
END_EVENT_TABLE()
// taken from wxStyledNotebook (c) Eran Ifrah <eranif@bezeqint.net>
static wxColor LightColour ( const wxColour& color, int percent )
{
int rd, gd, bd, high = 0;
wxColor end_color = wxT ( "WHITE" );
rd = end_color.Red() - color.Red();
gd = end_color.Green() - color.Green();
bd = end_color.Blue() - color.Blue();
high = 100;
// We take the percent way of the color from color --> white
int i = percent;
int r = color.Red() + ( ( i*rd*100 ) /high ) /100;
int g = color.Green() + ( ( i*gd*100 ) /high ) /100;
int b = color.Blue() + ( ( i*bd*100 ) /high ) /100;
return wxColor ( r, g, b );
}
MyToolBar::MyToolBar (
wxFrame *parent,
int id,
const wxPoint& pos,
const wxSize& size,
long style ) :
wxToolBar ( parent, id, pos, size, style )
{
/// Override colors
m_colorTo = LightColour ( wxSystemSettings::GetColour ( wxSYS_COLOUR_3DFACE ), 0 );
m_colorFrom = LightColour ( wxSystemSettings::GetColour ( wxSYS_COLOUR_3DFACE ), 80 );//60);
//m_colorFrom = LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENU), 0);
}
void MyToolBar::OnEraseBG ( wxEraseEvent& event )
{
wxDC* DC = event.GetDC();
wxWindow *Window = dynamic_cast<wxWindow *> ( event.GetEventObject() );
assert ( Window );
int x, y, w, h;
x = y = 0;
Window->GetSize ( &w, &h );
wxRect rect ( x, y, w, h );
PaintStraightGradientBox ( DC, rect, m_colorFrom, m_colorTo );
}
// adapted from wxFlatNotebook (c) Eran Ifrah
void MyToolBar::PaintStraightGradientBox ( wxDC *dc, const wxRect& rect, const wxColour& startColor, const wxColour& endColor, bool vertical )
{
int rd, gd, bd, high = 0;
rd = endColor.Red() - startColor.Red();
gd = endColor.Green() - startColor.Green();
bd = endColor.Blue() - startColor.Blue();
/// Save the current pen and brush
wxPen savedPen = dc->GetPen();
wxBrush savedBrush = dc->GetBrush();
if ( vertical )
high = rect.GetHeight()-1;
else
high = rect.GetWidth()-1;
if ( high < 1 )
return;
for ( int i = 0; i <= high; ++i )
{
int r = startColor.Red() + ( ( i*rd*100 ) /high ) /100;
int g = startColor.Green() + ( ( i*gd*100 ) /high ) /100;
int b = startColor.Blue() + ( ( i*bd*100 ) /high ) /100;
wxPen p ( wxColor ( r, g, b ) );
dc->SetPen ( p );
if ( vertical )
dc->DrawLine ( rect.x, rect.y+i, rect.x+rect.width, rect.y+i );
else
dc->DrawLine ( rect.x+i, rect.y, rect.x+i, rect.y+rect.height );
}
/// Restore the pen and brush
dc->SetPen ( savedPen );
dc->SetBrush ( savedBrush );
}

View File

@ -1,51 +0,0 @@
/*
* Copyright 2005-2007 Gerald Schmidt.
*
* This file is part of Xml Copy Editor.
*
* Xml Copy Editor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* Xml Copy Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xml Copy Editor; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// mytoolbar.h
#ifndef MY_TOOLBAR
#define MY_TOOLBAR
#include <wx/wx.h>
#include <wx/dcbuffer.h>
class MyToolBar : public wxToolBar
{
public:
MyToolBar (
wxFrame *parent,
int id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0 );
void OnEraseBG ( wxEraseEvent& event );
private:
wxColour m_colorFrom, m_colorTo, m_colorBorder;
//void FillGradientColor(wxDC *dc, const wxRect& rect);
void PaintStraightGradientBox (
wxDC *dc,
const wxRect& rect,
const wxColour& startColor,
const wxColour& endColor,
bool vertical = true );
DECLARE_EVENT_TABLE()
};
#endif

View File

@ -60,9 +60,7 @@
#include "findreplacepanel.h"
#endif
#ifdef __WXMSW__
#include <wx/msw/uxtheme.h>
#else
#ifndef __WXMSW__
#include "wrapxerces.h"
#include "xpm/appicon.xpm"
#endif
@ -546,10 +544,6 @@ MyFrame::MyFrame (
_T ( "Bitstream Vera Sans" );
#endif
#ifdef __WXMSW__
coolBar = NULL;
#endif
bool findMatchCase;
// fetch configuration
@ -663,9 +657,6 @@ MyFrame::MyFrame (
showInsertEntityPane = config->Read ( _T ( "showInsertEntityPane" ), true );
expandInternalEntities = config->Read ( _T ( "expandInternalEntities" ), true );
#ifdef __WXMSW__
useCoolBar = config->Read ( _T ( "useCoolBar" ), true );
#endif
}
else // config not found
{
@ -715,9 +706,6 @@ MyFrame::MyFrame (
commandOutput = ID_COMMAND_OUTPUT_IGNORE;
commandString = wxEmptyString;
#ifdef __WXMSW__
useCoolBar = true;
#endif
}
largeFileProperties.completion = false;
@ -790,10 +778,6 @@ MyFrame::MyFrame (
stylePosition = aboutPosition = wxDefaultPosition;
styleSize = wxSize ( 720, 540 );
#ifdef __WXMSW__
useCoolBarOnStart = useCoolBar;
#endif
showTopBars ( toolbarVisible );
long style = wxAUI_NB_TOP |
@ -980,10 +964,6 @@ MyFrame::~MyFrame()
config->Write ( _T ( "commandOutput" ), commandPanel->getOutput() );
config->Write ( _T ( "commandString" ), commandPanel->getCommand() );
#ifdef __WXMSW__
config->Write ( _T ( "useCoolBar" ), useCoolBar );
#endif
config->Write ( _T ( "restoreLayout" ), restoreLayout );
@ -1035,32 +1015,6 @@ wxString MyFrame::getLinuxBrowser()
void MyFrame::showTopBars ( bool b )
{
#ifdef __WXMSW__
if ( useCoolBarOnStart )
{
if ( coolBar )
{
manager.DetachPane ( coolBar );
manager.Update();
coolBar->ShowBand ( 1, b );
manager.AddPane ( coolBar, wxAuiPaneInfo().Top().CaptionVisible ( false ).Name ( _T ( "coolBar" ) ) );
}
else
{
toolBar = getToolBar();
SetToolBar ( NULL );
if ( toolBar && protectTags )
toolBar->ToggleTool ( ID_PROTECT_TAGS, protectTags );
menuBar = getMenuBar();
coolBar = new wxCoolBar ( this, -1 );
coolBar->AddBand ( menuBar, false, wxEmptyString, true );
coolBar->AddBand ( toolBar, true, wxEmptyString, true );
coolBar->ShowBand ( 1, b );
manager.AddPane ( coolBar, wxAuiPaneInfo().Top().CaptionVisible ( false ).Name ( _T ( "coolBar" ) ) );
}
return;
}
#endif
if ( !menuBar )
{
SetToolBar ( NULL );
@ -2349,9 +2303,6 @@ void MyFrame::OnOptions ( wxCommandEvent& WXUNUSED ( event ) )
expandInternalEntities,
showFullPathOnFrame,
lang,
#ifdef __WXMSW__
useCoolBar,
#endif
wxID_ANY,
title ) );
if ( mpsd->ShowModal() == wxID_OK )
@ -2369,9 +2320,6 @@ void MyFrame::OnOptions ( wxCommandEvent& WXUNUSED ( event ) )
expandInternalEntities = mpsd->getExpandInternalEntities();
showFullPathOnFrame = mpsd->getShowFullPathOnFrame();
lang = mpsd->getLang();
#ifdef __WXMSW__
useCoolBar = mpsd->getUseCoolBar();
#endif
updatePaths();
}
if ( doc )
@ -4217,14 +4165,7 @@ void MyFrame::OnToolbarVisible ( wxCommandEvent& event )
{
if ( !viewMenu )
return;
#ifdef __WXMSW__
if ( useCoolBarOnStart )
toolbarVisible = ( viewMenu->IsChecked ( ID_TOOLBAR_VISIBLE ) ) ? false : true;
else
toolbarVisible = ( toolbarVisible ) ? false : true;
#else
toolbarVisible = ( toolbarVisible ) ? false : true;
#endif
viewMenu->Check ( ID_TOOLBAR_VISIBLE, toolbarVisible );
showTopBars ( toolbarVisible );
manager.Update();
@ -4274,15 +4215,7 @@ void MyFrame::OnProtectTags ( wxCommandEvent& event )
{
if ( !xmlMenu )
return;
#ifdef __WXMSW__
if ( useCoolBarOnStart )
protectTags = ( xmlMenu->IsChecked ( ID_PROTECT_TAGS ) ) ? false : true;
else
protectTags = ( protectTags ) ? false : true;
#else
protectTags = ( protectTags ) ? false : true;
#endif
if ( xmlMenu )
xmlMenu->Check ( ID_PROTECT_TAGS, protectTags );
if ( toolBar )
@ -4856,21 +4789,12 @@ void MyFrame::displaySavedStatus ( int bytes )
statusProgress ( msg );
}
bool MyFrame::xpThemeActive()
{
#ifndef __WXMSW__
return false;
#else
return ( wxUxThemeEngine::Get() && wxUxThemeEngine::Get()->IsThemeActive() );
#endif
}
bool MyFrame::getHandleCommandLineFlag()
{
return handleCommandLineFlag;
}
MyMenuBar *MyFrame::getMenuBar()
wxMenuBar *MyFrame::getMenuBar()
{
fileMenu = new wxMenu; // use class-wide data member
updateFileMenu ( false );
@ -5236,7 +5160,7 @@ MyMenuBar *MyFrame::getMenuBar()
helpMenu->AppendSeparator();
helpMenu->Append ( aboutItem );
MyMenuBar *menuBar = new MyMenuBar ( wxMB_DOCKABLE );
wxMenuBar *menuBar = new wxMenuBar ( wxMB_DOCKABLE );
menuBar->Append ( fileMenu, _ ( "&File" ) );
menuBar->Append ( editMenu, _ ( "&Edit" ) );
menuBar->Append ( viewMenu, _ ( "&View" ) );
@ -5328,9 +5252,9 @@ void MyFrame::updateFileMenu ( bool deleteExisting )
fileMenu->Append ( exitItem );
}
MyToolBar *MyFrame::getToolBar()
wxToolBar *MyFrame::getToolBar()
{
MyToolBar *myToolBar = new MyToolBar (
wxToolBar *toolBar = new wxToolBar (
this,
ID_TOOLBAR,
wxDefaultPosition,
@ -5344,40 +5268,40 @@ MyToolBar *MyFrame::getToolBar()
#else
w = h = 24;
#endif
myToolBar->SetToolBitmapSize ( wxSize ( w, h ) );
toolBar->SetToolBitmapSize ( wxSize ( w, h ) );
myToolBar->AddTool (
toolBar->AddTool (
wxID_NEW,
_ ( "New" ),
newBitmap,
_ ( "New" ) );
myToolBar->AddTool (
toolBar->AddTool (
wxID_OPEN,
_ ( "Open" ),
openBitmap,
_ ( "Open" ) );
myToolBar->AddTool (
toolBar->AddTool (
wxID_SAVE,
_ ( "Save" ),
saveBitmap,
wxNullBitmap,
wxITEM_NORMAL,
_ ( "Save" ) );
myToolBar->AddTool (
toolBar->AddTool (
ID_PRINT,
_ ( "Print" ),
printBitmap,
wxNullBitmap,
wxITEM_NORMAL,
_ ( "Print" ) );
myToolBar->AddTool (
toolBar->AddTool (
ID_BROWSER,
_ ( "Browser" ),
internetBitmap,
wxNullBitmap,
wxITEM_NORMAL,
_ ( "Browser" ) );
myToolBar->AddTool (
toolBar->AddTool (
ID_SPELL,
_ ( "Spelling and Style" ),
spellingBitmap,
@ -5385,17 +5309,17 @@ MyToolBar *MyFrame::getToolBar()
wxITEM_NORMAL,
_ ( "Spelling and Style" ) );
myToolBar->AddCheckTool (
toolBar->AddCheckTool (
ID_PROTECT_TAGS,
_ ( "Lock Tags" ),
hyperlinkBitmap,
wxNullBitmap,
_ ( "Lock Tags" ) );
myToolBar->ToggleTool (
toolBar->ToggleTool (
ID_PROTECT_TAGS, protectTags );
myToolBar->Realize();
return myToolBar;
toolBar->Realize();
return toolBar;
}
XmlDoc *MyFrame::getActiveDocument()
@ -5407,11 +5331,6 @@ XmlDoc *MyFrame::getActiveDocument()
void MyFrame::addSafeSeparator ( wxToolBar *toolBar )
{
if ( xpThemeActive() )
{
toolBar->AddSeparator();
return;
}
wxStaticText *staticControl = new wxStaticText (
toolBar,
wxID_ANY,
@ -5911,6 +5830,8 @@ void MyFrame::loadBitmaps()
helpBitmap = wxBITMAP ( stock_help_16 );
#else
// toolbar icons
newBitmap.LoadFile ( pngDir + _T ( "stock_new.png" ), wxBITMAP_TYPE_PNG );
openBitmap.LoadFile ( pngDir + _T ( "stock_open.png" ), wxBITMAP_TYPE_PNG );
saveBitmap.LoadFile ( pngDir + _T ( "stock_save.png" ), wxBITMAP_TYPE_PNG );

View File

@ -53,14 +53,8 @@
#include "xmlencodinghandler.h"
#include "myipc.h"
#include "xmlcopyeditorcopy.h"
#include "mytoolbar.h"
#include "mymenubar.h"
#include <wx/aui/framemanager.h>
#ifdef __WXMSW__
#include "wxcoolbar.h"
#endif
enum
{
STATUS_HIDDEN = 1,
@ -342,8 +336,8 @@ private:
std::auto_ptr<wxHtmlHelpController> helpController;
wxBoxSizer *frameSizer;
MyMenuBar *menuBar;
MyToolBar *toolBar;
wxMenuBar *menuBar;
wxToolBar *toolBar;
LocationPanel *locationPanel;
InsertPanel *insertChildPanel, *insertSiblingPanel, *insertEntityPanel;
@ -460,9 +454,6 @@ private:
wxFileHistory history;
wxFindReplaceData findData;
XmlCtrlProperties properties, largeFileProperties;
#ifdef __WXMSW__
wxCoolBar *coolBar;
#endif
// member functions
bool panelHasFocus();
@ -470,7 +461,6 @@ private:
XmlDoc *doc,
wxString& fileName,
bool checkLastModified = true );
bool xpThemeActive();
int getFileType ( const wxString& fileName );
long getNotebookStyleMask();
wxString getLinuxBrowser();
@ -502,8 +492,8 @@ private:
bool isXml = true );
void removeUtf8Bom ( std::string& buffer );
std::string getAuxPath ( const std::string& fileName );
MyMenuBar *getMenuBar();
MyToolBar *getToolBar();
wxMenuBar *getMenuBar();
wxToolBar *getToolBar();
DECLARE_EVENT_TABLE()
};

View File

@ -1,5 +1,5 @@
%define name xmlcopyeditor
%define version 1.1.0.1
%define version 1.1.0.3
%define release 1
%define author Gerald Schmidt <gnschmidt@users.sourceforge.net>
%define prefix /usr/local

View File

@ -36,5 +36,5 @@
"License along with this program; if not, write to the Free\n"\
"Software Foundation, Inc., 59 Temple Place, Suite 330,\n"\
"Boston, MA 02111-1307 USA.")
#define ABOUT_VERSION _T("1.1.0.2")
#define ABOUT_VERSION _T("1.1.0.3")
#define XMLCE_VAR _T("XMLCE_VAR")