In DialogEd, changed Close to Destroy to make it shut down properly.
Various Motif fixes incl. fixing window colours, menu fonts/colours, dialog box git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,7 +7,7 @@ config.sub
|
|||||||
wx-config.in
|
wx-config.in
|
||||||
mkinstalldirs
|
mkinstalldirs
|
||||||
|
|
||||||
makeenvs/*.env
|
src/makeenvs/*.env
|
||||||
|
|
||||||
src/Makefile
|
src/Makefile
|
||||||
src/Makefile.in
|
src/Makefile.in
|
||||||
|
@@ -4,6 +4,10 @@ docs/licence.txt
|
|||||||
distrib/msw/*.rsp
|
distrib/msw/*.rsp
|
||||||
distrib/msw/*.bat
|
distrib/msw/*.bat
|
||||||
|
|
||||||
|
tools/gettext/xgettext.exe
|
||||||
|
tools/gettext/msgfmt.exe
|
||||||
|
tools/gettext/msgunfmt.exe
|
||||||
|
|
||||||
src/makeb32.env
|
src/makeb32.env
|
||||||
src/makebcc.env
|
src/makebcc.env
|
||||||
src/makemsw.env
|
src/makemsw.env
|
||||||
|
@@ -33,3 +33,5 @@ docs/html/tex2rtf/*.gif
|
|||||||
|
|
||||||
docs/html/odbc/*.htm
|
docs/html/odbc/*.htm
|
||||||
|
|
||||||
|
docs/html/gettext/*.htm
|
||||||
|
|
||||||
|
@@ -258,10 +258,16 @@ Iconizes or restores the frame.
|
|||||||
|
|
||||||
\membersection{wxFrame::IsIconized}\label{wxframeisiconized}
|
\membersection{wxFrame::IsIconized}\label{wxframeisiconized}
|
||||||
|
|
||||||
\func{bool}{IsIconized}{\void}
|
\constfunc{bool}{IsIconized}{\void}
|
||||||
|
|
||||||
Returns TRUE if the frame is iconized.
|
Returns TRUE if the frame is iconized.
|
||||||
|
|
||||||
|
\membersection{wxFrame::IsMaximized}\label{wxframeismaximized}
|
||||||
|
|
||||||
|
\constfunc{bool}{IsMaximized}{\void}
|
||||||
|
|
||||||
|
Returns TRUE if the frame is maximized.
|
||||||
|
|
||||||
\membersection{wxFrame::LoadAccelerators}\label{wxframeloadaccelerators}
|
\membersection{wxFrame::LoadAccelerators}\label{wxframeloadaccelerators}
|
||||||
|
|
||||||
\func{void}{LoadAccelerators}{\param{const wxString\& }{table}}
|
\func{void}{LoadAccelerators}{\param{const wxString\& }{table}}
|
||||||
|
@@ -15,8 +15,10 @@ labelled buttons.
|
|||||||
|
|
||||||
\twocolwidtha{5cm}
|
\twocolwidtha{5cm}
|
||||||
\begin{twocollist}\itemsep=0pt
|
\begin{twocollist}\itemsep=0pt
|
||||||
\twocolitem{\windowstyle{wxRA\_HORIZONTAL}}{Lays the radiobox out in rows.}
|
\twocolitem{\windowstyle{wxRA\_SPECIFY\_ROWS}}{The major dimension parameter refers to the
|
||||||
\twocolitem{\windowstyle{wxRA\_VERTICAL}}{Lays the radiobox out in columns.}
|
maximum number of rows.}
|
||||||
|
\twocolitem{\windowstyle{wxRA\_SPECIFY\_COLS}}{The major dimension parameter refers to the
|
||||||
|
maximum number of columns.}
|
||||||
\end{twocollist}
|
\end{twocollist}
|
||||||
|
|
||||||
See also \helpref{window styles overview}{windowstyles}.
|
See also \helpref{window styles overview}{windowstyles}.
|
||||||
@@ -45,7 +47,7 @@ Default constructor.
|
|||||||
\func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
|
\func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
|
||||||
\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||||
\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
|
\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
|
||||||
\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_HORIZONTAL},\rtfsp
|
\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
|
||||||
\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
|
\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
|
||||||
\param{const wxString\& }{name = ``radioBox"}}
|
\param{const wxString\& }{name = ``radioBox"}}
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ Constructor, creating and showing a radiobox.
|
|||||||
|
|
||||||
\docparam{choices}{An array of choices with which to initialize the radiobox.}
|
\docparam{choices}{An array of choices with which to initialize the radiobox.}
|
||||||
|
|
||||||
\docparam{majorDimension}{Specifies the number of rows (if style is wxRA\_VERTICAL) or columns (if style is wxRA\_HORIZONTAL) for a two-dimensional
|
\docparam{majorDimension}{Specifies the maximum number of rows (if style contains wxRA\_SPECIFY\_ROWS) or columns (if style contains wxRA\_SPECIFY\_COLS) for a two-dimensional
|
||||||
radiobox.}
|
radiobox.}
|
||||||
|
|
||||||
\docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.}
|
\docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.}
|
||||||
@@ -91,7 +93,7 @@ Destructor, destroying the radiobox item.
|
|||||||
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
|
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
|
||||||
\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
||||||
\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
|
\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
|
||||||
\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_HORIZONTAL},\rtfsp
|
\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
|
||||||
\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
|
\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
|
||||||
\param{const wxString\& }{name = ``radioBox"}}
|
\param{const wxString\& }{name = ``radioBox"}}
|
||||||
|
|
||||||
|
@@ -74,4 +74,18 @@ More recently:
|
|||||||
with gcc) and the sample is now partially working. Some work
|
with gcc) and the sample is now partially working. Some work
|
||||||
on the scrollbars is required.
|
on the scrollbars is required.
|
||||||
- wxListCtrl assumed that one of the args to GetClientSize can be NULL:
|
- wxListCtrl assumed that one of the args to GetClientSize can be NULL:
|
||||||
corrected.
|
corrected.
|
||||||
|
|
||||||
|
18/12/98
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Removed major bug whereby dialogs were unmanaged automatically
|
||||||
|
when any button was pressed.
|
||||||
|
- Fixed colours of wxWindow scrollbars, made list and text controls
|
||||||
|
have a white background.
|
||||||
|
- Fixed dialog colour setting.
|
||||||
|
- Added settable fonts and colours for wxMenu/wxMenuBar. Now
|
||||||
|
they have sensible colours by default.
|
||||||
|
- Fixed a bug in wxStaticBox.
|
||||||
|
- Controls sample runs, though wxRadioBox doesn't appear and
|
||||||
|
the notebook flickers for a while.
|
||||||
|
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
|
#include "wx/font.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxMenuItem;
|
class WXDLLEXPORT wxMenuItem;
|
||||||
class WXDLLEXPORT wxMenuBar;
|
class WXDLLEXPORT wxMenuBar;
|
||||||
@@ -115,6 +117,15 @@ public:
|
|||||||
void DestroyMenu(bool full);
|
void DestroyMenu(bool full);
|
||||||
WXWidget FindMenuItem(int id, wxMenuItem **it = NULL) const;
|
WXWidget FindMenuItem(int id, wxMenuItem **it = NULL) const;
|
||||||
|
|
||||||
|
const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
|
||||||
|
const wxColour& GetForegroundColour() const { return m_foregroundColour; }
|
||||||
|
const wxFont& GetFont() const { return m_font; }
|
||||||
|
|
||||||
|
void SetBackgroundColour(const wxColour& colour);
|
||||||
|
void SetForegroundColour(const wxColour& colour);
|
||||||
|
void SetFont(const wxFont& colour);
|
||||||
|
void ChangeFont(bool keepOriginalSize = FALSE);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxFunction m_callback;
|
wxFunction m_callback;
|
||||||
|
|
||||||
@@ -135,6 +146,9 @@ public:
|
|||||||
wxMenu* m_topLevelMenu ;
|
wxMenu* m_topLevelMenu ;
|
||||||
wxMenu* m_menuParent;
|
wxMenu* m_menuParent;
|
||||||
bool m_ownedByMenuBar;
|
bool m_ownedByMenuBar;
|
||||||
|
wxColour m_foregroundColour;
|
||||||
|
wxColour m_backgroundColour;
|
||||||
|
wxFont m_font;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -194,6 +208,15 @@ class WXDLLEXPORT wxMenuBar: public wxEvtHandler
|
|||||||
// Destroy menubar, but keep data structures intact so we can recreate it.
|
// Destroy menubar, but keep data structures intact so we can recreate it.
|
||||||
bool DestroyMenuBar();
|
bool DestroyMenuBar();
|
||||||
|
|
||||||
|
const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
|
||||||
|
const wxColour& GetForegroundColour() const { return m_foregroundColour; }
|
||||||
|
const wxFont& GetFont() const { return m_font; }
|
||||||
|
|
||||||
|
void SetBackgroundColour(const wxColour& colour);
|
||||||
|
void SetForegroundColour(const wxColour& colour);
|
||||||
|
void SetFont(const wxFont& colour);
|
||||||
|
void ChangeFont(bool keepOriginalSize = FALSE);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxEvtHandler * m_eventHandler;
|
wxEvtHandler * m_eventHandler;
|
||||||
int m_menuCount;
|
int m_menuCount;
|
||||||
@@ -204,6 +227,9 @@ class WXDLLEXPORT wxMenuBar: public wxEvtHandler
|
|||||||
//// Motif-specific
|
//// Motif-specific
|
||||||
WXWidget m_mainWidget;
|
WXWidget m_mainWidget;
|
||||||
|
|
||||||
|
wxColour m_foregroundColour;
|
||||||
|
wxColour m_backgroundColour;
|
||||||
|
wxFont m_font;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_MENU_H_
|
#endif // _WX_MENU_H_
|
||||||
|
@@ -38,6 +38,9 @@ Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap );
|
|||||||
extern XColor g_itemColors[];
|
extern XColor g_itemColors[];
|
||||||
extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
|
extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
|
||||||
|
|
||||||
|
extern void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
|
||||||
|
extern void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
|
||||||
|
|
||||||
#define wxNO_COLORS 0x00
|
#define wxNO_COLORS 0x00
|
||||||
#define wxBACK_COLORS 0x01
|
#define wxBACK_COLORS 0x01
|
||||||
#define wxFORE_COLORS 0x02
|
#define wxFORE_COLORS 0x02
|
||||||
|
@@ -81,6 +81,7 @@ public:
|
|||||||
void SetTitle(const wxString& title);
|
void SetTitle(const wxString& title);
|
||||||
wxString GetTitle() const ;
|
wxString GetTitle() const ;
|
||||||
|
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
bool OnClose();
|
bool OnClose();
|
||||||
void OnCharHook(wxKeyEvent& event);
|
void OnCharHook(wxKeyEvent& event);
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
@@ -369,9 +369,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
|
|||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
panel->SetBackgroundColour("cadet blue");
|
panel->SetBackgroundColour("cadet blue");
|
||||||
panel->SetForegroundColour("blue");
|
panel->SetForegroundColour("blue");
|
||||||
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_VERTICAL );
|
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_SPECIFY_ROWS );
|
||||||
m_radio->SetBackgroundColour("wheat");
|
m_radio->SetBackgroundColour("wheat");
|
||||||
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_HORIZONTAL );
|
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_radio->SetBackgroundColour("wheat");
|
m_radio->SetBackgroundColour("wheat");
|
||||||
(void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
|
(void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
|
||||||
(void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
|
(void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
|
||||||
|
78
samples/makefile.unx
Normal file
78
samples/makefile.unx
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#
|
||||||
|
# Makefile : Builds wxWindows utils for Unix.
|
||||||
|
|
||||||
|
# Replace this with your own path if necessary
|
||||||
|
WXDIR = ..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/make.env
|
||||||
|
|
||||||
|
TARGET=motif
|
||||||
|
|
||||||
|
# Change these if needed.
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)/samples
|
||||||
|
|
||||||
|
all:
|
||||||
|
cd config; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd controls; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd dialogs; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd dnd; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd docview; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd docvwmdi; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd dynamic; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd grid; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd help; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd image; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd internat; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd layout; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd memcheck; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd minifram; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd minimal; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd nativdlg; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd notebook; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd printing; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd resource; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd sashtest; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd splitter; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd tab; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd thread; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd toolbar; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd typetest; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd validate; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd treectrl; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
cd wxpoem; $(MAKE) -f makefile.unx $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
cd config; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd controls; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd dialogs; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd dnd; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd docview; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd docvwmdi; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd dynamic; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd grid; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd help; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd image; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd internat; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd layout; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd memcheck; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd minifram; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd minimal; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd nativdlg; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd notebook; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd printing; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd resource; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd sashtest; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd splitter; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd tab; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd thread; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd toolbar; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd typetest; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd validate; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd treectrl; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
cd wxpoem; $(MAKE) -f makefile.unx clean$(TARGET)
|
||||||
|
|
||||||
|
cleanmotif: clean
|
||||||
|
motif: all
|
@@ -1036,7 +1036,8 @@ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bo
|
|||||||
return (void *)malloc(size);
|
return (void *)malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
char * buf = (char *) malloc(wxDebugContext::TotSize (size));
|
int totSize = wxDebugContext::TotSize (size);
|
||||||
|
char * buf = (char *) malloc(totSize);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
wxLogDebug("Call to malloc (%ld) failed.", (long)size);
|
wxLogDebug("Call to malloc (%ld) failed.", (long)size);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -1770,6 +1770,8 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
|
|||||||
|
|
||||||
/* wxRadioBox/wxRadioButton */
|
/* wxRadioBox/wxRadioButton */
|
||||||
{ "wxRB_GROUP", wxRB_GROUP },
|
{ "wxRB_GROUP", wxRB_GROUP },
|
||||||
|
{ "wxRA_SPECIFY_COLS", wxRA_SPECIFY_COLS },
|
||||||
|
{ "wxRA_SPECIFY_ROWS", wxRA_SPECIFY_ROWS },
|
||||||
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
|
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
|
||||||
{ "wxRA_VERTICAL", wxRA_VERTICAL },
|
{ "wxRA_VERTICAL", wxRA_VERTICAL },
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
|
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
|
BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
|
||||||
EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
|
EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
|
||||||
EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
|
EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
|
||||||
EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
|
EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
|
||||||
EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
|
EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
|
||||||
|
@@ -1369,10 +1369,10 @@ void wxListMainWindow::OnArrowChar( wxListLineData *newCurrent, bool shiftDown )
|
|||||||
|
|
||||||
void wxListMainWindow::OnChar( wxKeyEvent &event )
|
void wxListMainWindow::OnChar( wxKeyEvent &event )
|
||||||
{
|
{
|
||||||
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, m_parent->GetId() );
|
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
|
||||||
le.m_code = event.KeyCode();
|
le.m_code = event.KeyCode();
|
||||||
le.SetEventObject( m_parent );
|
le.SetEventObject( GetParent() );
|
||||||
m_parent->GetEventHandler()->ProcessEvent( le );
|
GetParent()->GetEventHandler()->ProcessEvent( le );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (event.KeyCode() == WXK_TAB)
|
if (event.KeyCode() == WXK_TAB)
|
||||||
|
@@ -40,7 +40,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
SetValidator(validator);
|
SetValidator(validator);
|
||||||
m_noStrings = n;
|
m_noStrings = n;
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
m_backgroundColour = parent->GetBackgroundColour();
|
// m_backgroundColour = parent->GetBackgroundColour();
|
||||||
|
m_backgroundColour = * wxWHITE;
|
||||||
m_foregroundColour = parent->GetForegroundColour();
|
m_foregroundColour = parent->GetForegroundColour();
|
||||||
|
|
||||||
if (parent) parent->AddChild(this);
|
if (parent) parent->AddChild(this);
|
||||||
|
@@ -117,9 +117,10 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
wxASSERT_MSG( (parentWidget != (Widget) 0), "Could not find a suitable parent shell for dialog." );
|
wxASSERT_MSG( (parentWidget != (Widget) 0), "Could not find a suitable parent shell for dialog." );
|
||||||
|
|
||||||
Arg args[1];
|
Arg args[2];
|
||||||
XtSetArg (args[0], XmNdefaultPosition, False);
|
XtSetArg (args[0], XmNdefaultPosition, False);
|
||||||
Widget dialogShell = XmCreateBulletinBoardDialog(parentWidget, (char*) (const char*) name, args, 1);
|
XtSetArg (args[1], XmNautoUnmanage, False);
|
||||||
|
Widget dialogShell = XmCreateBulletinBoardDialog(parentWidget, (char*) (const char*) name, args, 2);
|
||||||
m_mainWidget = (WXWidget) dialogShell;
|
m_mainWidget = (WXWidget) dialogShell;
|
||||||
|
|
||||||
// We don't want margins, since there is enough elsewhere.
|
// We don't want margins, since there is enough elsewhere.
|
||||||
@@ -474,7 +475,8 @@ int wxDialog::ShowModal()
|
|||||||
wxModalShowingStack.Insert((wxObject *)TRUE);
|
wxModalShowingStack.Insert((wxObject *)TRUE);
|
||||||
|
|
||||||
m_modalShowing = TRUE;
|
m_modalShowing = TRUE;
|
||||||
XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
|
// XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
|
||||||
|
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
|
||||||
// Loop until we signal that the dialog should be closed
|
// Loop until we signal that the dialog should be closed
|
||||||
@@ -710,18 +712,20 @@ static void wxUnmapBulletinBoard(Widget WXUNUSED(dialog), wxDialog *WXUNUSED(cli
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDialog::ChangeFont(bool WXUNUSED(keepOriginalSize))
|
void wxDialog::ChangeFont(bool keepOriginalSize)
|
||||||
{
|
{
|
||||||
// TODO
|
wxWindow::ChangeFont(keepOriginalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDialog::ChangeBackgroundColour()
|
void wxDialog::ChangeBackgroundColour()
|
||||||
{
|
{
|
||||||
// TODO
|
if (GetMainWidget())
|
||||||
|
DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDialog::ChangeForegroundColour()
|
void wxDialog::ChangeForegroundColour()
|
||||||
{
|
{
|
||||||
// TODO
|
if (GetMainWidget())
|
||||||
|
DoChangeForegroundColour(GetMainWidget(), m_foregroundColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
m_noItems = n;
|
m_noItems = n;
|
||||||
m_selected = 0;
|
m_selected = 0;
|
||||||
m_backgroundColour = parent->GetBackgroundColour();
|
// m_backgroundColour = parent->GetBackgroundColour();
|
||||||
|
m_backgroundColour = * wxWHITE;
|
||||||
m_foregroundColour = parent->GetForegroundColour();
|
m_foregroundColour = parent->GetForegroundColour();
|
||||||
|
|
||||||
SetName(name);
|
SetName(name);
|
||||||
@@ -760,9 +761,10 @@ void wxListBox::ChangeBackgroundColour()
|
|||||||
|
|
||||||
/* TODO: should scrollbars be affected? Should probably have separate
|
/* TODO: should scrollbars be affected? Should probably have separate
|
||||||
* function to change them (by default, taken from wxSystemSettings)
|
* function to change them (by default, taken from wxSystemSettings)
|
||||||
DoChangeBackgroundColour((WXWidget) hsb, m_backgroundColour, TRUE);
|
*/
|
||||||
DoChangeBackgroundColour((WXWidget) vsb, m_backgroundColour, TRUE);
|
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||||
*/
|
DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
|
||||||
|
DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
|
||||||
|
|
||||||
DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
|
DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,6 @@ LIB_CPP_SRC=\
|
|||||||
dcmemory.cpp \
|
dcmemory.cpp \
|
||||||
dcscreen.cpp \
|
dcscreen.cpp \
|
||||||
dialog.cpp \
|
dialog.cpp \
|
||||||
dirdlg.cpp \
|
|
||||||
dnd.cpp \
|
dnd.cpp \
|
||||||
filedlg.cpp \
|
filedlg.cpp \
|
||||||
font.cpp \
|
font.cpp \
|
||||||
@@ -136,6 +135,7 @@ LIB_CPP_SRC=\
|
|||||||
\
|
\
|
||||||
../generic/choicdgg.cpp \
|
../generic/choicdgg.cpp \
|
||||||
../generic/colrdlgg.cpp \
|
../generic/colrdlgg.cpp \
|
||||||
|
../generic/dirdlgg.cpp \
|
||||||
../generic/fontdlgg.cpp \
|
../generic/fontdlgg.cpp \
|
||||||
../generic/gridg.cpp \
|
../generic/gridg.cpp \
|
||||||
../generic/helpext.cpp \
|
../generic/helpext.cpp \
|
||||||
@@ -156,6 +156,7 @@ LIB_CPP_SRC=\
|
|||||||
|
|
||||||
# If you're not using the generic ones, you
|
# If you're not using the generic ones, you
|
||||||
# may wish to define platform-specific ones
|
# may wish to define platform-specific ones
|
||||||
|
# dirdlg.cpp \
|
||||||
# treectrl.cpp \
|
# treectrl.cpp \
|
||||||
# listctrl.cpp \
|
# listctrl.cpp \
|
||||||
# imaglist.cpp \
|
# imaglist.cpp \
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
|
||||||
#include <Xm/Label.h>
|
#include <Xm/Label.h>
|
||||||
#include <Xm/LabelG.h>
|
#include <Xm/LabelG.h>
|
||||||
@@ -81,6 +82,9 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func)
|
|||||||
Append(ID_SEPARATOR, m_title) ;
|
Append(ID_SEPARATOR, m_title) ;
|
||||||
AppendSeparator() ;
|
AppendSeparator() ;
|
||||||
}
|
}
|
||||||
|
m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU);
|
||||||
|
m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT);
|
||||||
|
m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
|
|
||||||
Callback(func);
|
Callback(func);
|
||||||
}
|
}
|
||||||
@@ -456,6 +460,9 @@ wxMenuBar::wxMenuBar()
|
|||||||
m_titles = NULL;
|
m_titles = NULL;
|
||||||
m_menuBarFrame = NULL;
|
m_menuBarFrame = NULL;
|
||||||
m_mainWidget = (WXWidget) NULL;
|
m_mainWidget = (WXWidget) NULL;
|
||||||
|
m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU);
|
||||||
|
m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT);
|
||||||
|
m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[])
|
wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[])
|
||||||
@@ -468,6 +475,9 @@ wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[])
|
|||||||
for ( i = 0; i < n; i++ )
|
for ( i = 0; i < n; i++ )
|
||||||
m_titles[i] = titles[i];
|
m_titles[i] = titles[i];
|
||||||
m_menuBarFrame = NULL;
|
m_menuBarFrame = NULL;
|
||||||
|
m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU);
|
||||||
|
m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT);
|
||||||
|
m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuBar::~wxMenuBar()
|
wxMenuBar::~wxMenuBar()
|
||||||
@@ -781,6 +791,10 @@ bool wxMenuBar::CreateMenuBar(wxFrame* parent)
|
|||||||
XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
|
XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetBackgroundColour(m_backgroundColour);
|
||||||
|
SetForegroundColour(m_foregroundColour);
|
||||||
|
SetFont(m_font);
|
||||||
|
|
||||||
XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
|
XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
|
||||||
XtRealizeWidget ((Widget) menuBarW);
|
XtRealizeWidget ((Widget) menuBarW);
|
||||||
XtManageChild ((Widget) menuBarW);
|
XtManageChild ((Widget) menuBarW);
|
||||||
@@ -921,6 +935,10 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
|
|||||||
item->CreateItem (menu, menuBar, topMenu);
|
item->CreateItem (menu, menuBar, topMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetBackgroundColour(m_backgroundColour);
|
||||||
|
SetForegroundColour(m_foregroundColour);
|
||||||
|
SetFont(m_font);
|
||||||
|
|
||||||
return buttonWidget;
|
return buttonWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -986,3 +1004,128 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
|
|||||||
*it = (wxMenuItem*) NULL;
|
*it = (wxMenuItem*) NULL;
|
||||||
return (WXWidget) NULL;
|
return (WXWidget) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetBackgroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
m_backgroundColour = col;
|
||||||
|
if (m_menuWidget)
|
||||||
|
wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
|
||||||
|
if (m_buttonWidget)
|
||||||
|
wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
|
||||||
|
|
||||||
|
wxNode* node = m_menuItems.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxMenuItem* item = (wxMenuItem*) node->Data();
|
||||||
|
if (item->GetButtonWidget())
|
||||||
|
{
|
||||||
|
// This crashes because it uses gadgets
|
||||||
|
// wxDoChangeBackgroundColour(item->GetButtonWidget(), (wxColour&) col, TRUE);
|
||||||
|
}
|
||||||
|
if (item->GetSubMenu())
|
||||||
|
item->GetSubMenu()->SetBackgroundColour((wxColour&) col);
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetForegroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
m_foregroundColour = col;
|
||||||
|
if (m_menuWidget)
|
||||||
|
wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col);
|
||||||
|
if (m_buttonWidget)
|
||||||
|
wxDoChangeForegroundColour(m_buttonWidget, (wxColour&) col);
|
||||||
|
|
||||||
|
wxNode* node = m_menuItems.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxMenuItem* item = (wxMenuItem*) node->Data();
|
||||||
|
if (item->GetButtonWidget())
|
||||||
|
{
|
||||||
|
// This crashes because it uses gadgets
|
||||||
|
// wxDoChangeForegroundColour(item->GetButtonWidget(), (wxColour&) col);
|
||||||
|
}
|
||||||
|
if (item->GetSubMenu())
|
||||||
|
item->GetSubMenu()->SetForegroundColour((wxColour&) col);
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::ChangeFont(bool keepOriginalSize)
|
||||||
|
{
|
||||||
|
// lesstif 0.87 hangs when setting XmNfontList
|
||||||
|
#ifndef LESSTIF_VERSION
|
||||||
|
if (!m_font.Ok() || !m_menuWidget)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_menuWidget));
|
||||||
|
|
||||||
|
XtVaSetValues ((Widget) m_menuWidget,
|
||||||
|
XmNfontList, fontList,
|
||||||
|
NULL);
|
||||||
|
if (m_buttonWidget)
|
||||||
|
{
|
||||||
|
XtVaSetValues ((Widget) m_buttonWidget,
|
||||||
|
XmNfontList, fontList,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
wxNode* node = m_menuItems.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxMenuItem* item = (wxMenuItem*) node->Data();
|
||||||
|
if (m_menuWidget && item->GetButtonWidget() && m_font.Ok())
|
||||||
|
{
|
||||||
|
XtVaSetValues ((Widget) item->GetButtonWidget(),
|
||||||
|
XmNfontList, fontList,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
if (item->GetSubMenu())
|
||||||
|
item->GetSubMenu()->ChangeFont(keepOriginalSize);
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetFont(const wxFont& font)
|
||||||
|
{
|
||||||
|
m_font = font;
|
||||||
|
ChangeFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::SetBackgroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_backgroundColour = col;
|
||||||
|
if (m_mainWidget)
|
||||||
|
wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col);
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
m_menus[i]->SetBackgroundColour((wxColour&) col);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::SetForegroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
m_foregroundColour = col;
|
||||||
|
if (m_mainWidget)
|
||||||
|
wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
m_menus[i]->SetForegroundColour((wxColour&) col);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::ChangeFont(bool keepOriginalSize)
|
||||||
|
{
|
||||||
|
// Nothing to do for menubar, fonts are kept in wxMenus
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::SetFont(const wxFont& font)
|
||||||
|
{
|
||||||
|
m_font = font;
|
||||||
|
ChangeFont();
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
m_menus[i]->SetFont(font);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -386,17 +386,46 @@ void wxRadioBox::Command (wxCommandEvent & event)
|
|||||||
|
|
||||||
void wxRadioBox::ChangeFont(bool keepOriginalSize)
|
void wxRadioBox::ChangeFont(bool keepOriginalSize)
|
||||||
{
|
{
|
||||||
// TODO
|
wxWindow::ChangeFont(keepOriginalSize);
|
||||||
|
|
||||||
|
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay((Widget) GetTopWidget()));
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_noItems; i++)
|
||||||
|
{
|
||||||
|
WXWidget radioButton = m_radioButtons[i];
|
||||||
|
|
||||||
|
XtVaSetValues ((Widget) radioButton,
|
||||||
|
XmNfontList, fontList,
|
||||||
|
XmNtopAttachment, XmATTACH_FORM,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::ChangeBackgroundColour()
|
void wxRadioBox::ChangeBackgroundColour()
|
||||||
{
|
{
|
||||||
// TODO
|
wxWindow::ChangeBackgroundColour();
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_noItems; i++)
|
||||||
|
{
|
||||||
|
WXWidget radioButton = m_radioButtons[i];
|
||||||
|
|
||||||
|
DoChangeBackgroundColour(radioButton, m_backgroundColour, TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::ChangeForegroundColour()
|
void wxRadioBox::ChangeForegroundColour()
|
||||||
{
|
{
|
||||||
// TODO
|
wxWindow::ChangeForegroundColour();
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_noItems; i++)
|
||||||
|
{
|
||||||
|
WXWidget radioButton = m_radioButtons[i];
|
||||||
|
|
||||||
|
DoChangeForegroundColour(radioButton, m_foregroundColour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBoxCallback (Widget w, XtPointer clientData,
|
void wxRadioBoxCallback (Widget w, XtPointer clientData,
|
||||||
|
@@ -114,10 +114,11 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
XmNrightAttachment, XmATTACH_FORM,
|
XmNrightAttachment, XmATTACH_FORM,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
m_mainWidget = (Widget) formWidget;
|
m_mainWidget = (WXWidget) frameWidget;
|
||||||
|
m_formWidget = (WXWidget) formWidget;
|
||||||
|
|
||||||
SetCanAddEventHandler(TRUE);
|
SetCanAddEventHandler(TRUE);
|
||||||
AttachWidget (parent, m_mainWidget, (WXWidget) frameWidget, pos.x, pos.y, size.x, size.y);
|
AttachWidget (parent, (WXWidget) frameWidget, (WXWidget) formWidget, pos.x, pos.y, size.x, size.y);
|
||||||
ChangeBackgroundColour();
|
ChangeBackgroundColour();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -80,7 +80,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
m_processedDefault = FALSE;
|
m_processedDefault = FALSE;
|
||||||
m_fileName = "";
|
m_fileName = "";
|
||||||
m_backgroundColour = parent->GetBackgroundColour();
|
// m_backgroundColour = parent->GetBackgroundColour();
|
||||||
|
m_backgroundColour = * wxWHITE;
|
||||||
m_foregroundColour = parent->GetForegroundColour();
|
m_foregroundColour = parent->GetForegroundColour();
|
||||||
|
|
||||||
SetName(name);
|
SetName(name);
|
||||||
@@ -649,46 +650,51 @@ void wxTextCtrl::ChangeBackgroundColour()
|
|||||||
{
|
{
|
||||||
wxWindow::ChangeBackgroundColour();
|
wxWindow::ChangeBackgroundColour();
|
||||||
|
|
||||||
Widget parent = XtParent ((Widget) m_mainWidget);
|
/* TODO: should scrollbars be affected? Should probably have separate
|
||||||
Widget hsb, vsb;
|
* function to change them (by default, taken from wxSystemSettings)
|
||||||
|
*/
|
||||||
|
if (m_windowStyle & wxTE_MULTILINE)
|
||||||
|
{
|
||||||
|
Widget parent = XtParent ((Widget) m_mainWidget);
|
||||||
|
Widget hsb, vsb;
|
||||||
|
|
||||||
XtVaGetValues (parent,
|
XtVaGetValues (parent,
|
||||||
XmNhorizontalScrollBar, &hsb,
|
XmNhorizontalScrollBar, &hsb,
|
||||||
XmNverticalScrollBar, &vsb,
|
XmNverticalScrollBar, &vsb,
|
||||||
NULL);
|
NULL);
|
||||||
|
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||||
|
if (hsb)
|
||||||
|
DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
|
||||||
|
if (vsb)
|
||||||
|
DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
|
||||||
|
|
||||||
/* TODO: should scrollbars be affected? Should probably have separate
|
DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
|
||||||
* function to change them (by default, taken from wxSystemSettings)
|
}
|
||||||
if (hsb)
|
|
||||||
DoChangeBackgroundColour((WXWidget) hsb, m_backgroundColour, TRUE);
|
|
||||||
if (vsb)
|
|
||||||
DoChangeBackgroundColour((WXWidget) vsb, m_backgroundColour, TRUE);
|
|
||||||
*/
|
|
||||||
|
|
||||||
DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::ChangeForegroundColour()
|
void wxTextCtrl::ChangeForegroundColour()
|
||||||
{
|
{
|
||||||
wxWindow::ChangeForegroundColour();
|
wxWindow::ChangeForegroundColour();
|
||||||
|
|
||||||
|
if (m_windowStyle & wxTE_MULTILINE)
|
||||||
|
{
|
||||||
|
Widget parent = XtParent ((Widget) m_mainWidget);
|
||||||
|
Widget hsb, vsb;
|
||||||
|
|
||||||
Widget parent = XtParent ((Widget) m_mainWidget);
|
XtVaGetValues (parent,
|
||||||
Widget hsb, vsb;
|
|
||||||
|
|
||||||
XtVaGetValues (parent,
|
|
||||||
XmNhorizontalScrollBar, &hsb,
|
XmNhorizontalScrollBar, &hsb,
|
||||||
XmNverticalScrollBar, &vsb,
|
XmNverticalScrollBar, &vsb,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* TODO: should scrollbars be affected? Should probably have separate
|
/* TODO: should scrollbars be affected? Should probably have separate
|
||||||
* function to change them (by default, taken from wxSystemSettings)
|
* function to change them (by default, taken from wxSystemSettings)
|
||||||
if (hsb)
|
if (hsb)
|
||||||
DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
|
DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
|
||||||
if (vsb)
|
if (vsb)
|
||||||
DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
|
DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
|
||||||
*/
|
*/
|
||||||
DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
|
DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)
|
static void wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)
|
||||||
|
@@ -182,6 +182,8 @@ bool wxToolBar::CreateTools()
|
|||||||
(XtPointer) this);
|
(XtPointer) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DoChangeBackgroundColour((WXWidget) button, m_backgroundColour, TRUE);
|
||||||
|
|
||||||
// For each button, if there is a mask, we must create
|
// For each button, if there is a mask, we must create
|
||||||
// a new wxBitmap that has the correct background colour
|
// a new wxBitmap that has the correct background colour
|
||||||
// for the button. Otherwise the background will just be
|
// for the button. Otherwise the background will just be
|
||||||
|
@@ -1240,3 +1240,43 @@ void wxAllocColor(Display *d,Colormap cmp,XColor *xc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// These functions duplicate those in wxWindow, but are needed
|
||||||
|
// for use outside of wxWindow (e.g. wxMenu, wxMenuBar).
|
||||||
|
|
||||||
|
// Change a widget's foreground and background colours.
|
||||||
|
|
||||||
|
void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
|
||||||
|
{
|
||||||
|
// When should we specify the foreground, if it's calculated
|
||||||
|
// by wxComputeColours?
|
||||||
|
// Solution: say we start with the default (computed) foreground colour.
|
||||||
|
// If we call SetForegroundColour explicitly for a control or window,
|
||||||
|
// then the foreground is changed.
|
||||||
|
// Therefore SetBackgroundColour computes the foreground colour, and
|
||||||
|
// SetForegroundColour changes the foreground colour. The ordering is
|
||||||
|
// important.
|
||||||
|
|
||||||
|
XtVaSetValues ((Widget) widget,
|
||||||
|
XmNforeground, foregroundColour.AllocColour(XtDisplay((Widget) widget)),
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour)
|
||||||
|
{
|
||||||
|
wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
|
||||||
|
(wxColour*) NULL);
|
||||||
|
|
||||||
|
XtVaSetValues ((Widget) widget,
|
||||||
|
XmNbackground, g_itemColors[wxBACK_INDEX].pixel,
|
||||||
|
XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel,
|
||||||
|
XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel,
|
||||||
|
XmNforeground, g_itemColors[wxFORE_INDEX].pixel,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (changeArmColour)
|
||||||
|
XtVaSetValues ((Widget) widget,
|
||||||
|
XmNarmColor, g_itemColors[wxSELE_INDEX].pixel,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -441,6 +441,10 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
m_hScrollBar = (WXWidget) hScrollBar;
|
m_hScrollBar = (WXWidget) hScrollBar;
|
||||||
|
|
||||||
|
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||||
|
DoChangeBackgroundColour(m_hScrollBar, backgroundColour, TRUE);
|
||||||
|
|
||||||
m_hScroll = TRUE;
|
m_hScroll = TRUE;
|
||||||
}
|
}
|
||||||
if (m_windowStyle & wxVSCROLL)
|
if (m_windowStyle & wxVSCROLL)
|
||||||
@@ -464,9 +468,17 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
m_vScrollBar = (WXWidget) vScrollBar;
|
m_vScrollBar = (WXWidget) vScrollBar;
|
||||||
|
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||||
|
DoChangeBackgroundColour(m_vScrollBar, backgroundColour, TRUE);
|
||||||
|
|
||||||
m_vScroll = TRUE;
|
m_vScroll = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scrolled widget needs to have its colour changed or we get
|
||||||
|
// a little blue square where the scrollbars abutt
|
||||||
|
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||||
|
DoChangeBackgroundColour(m_scrolledWindow, backgroundColour, TRUE);
|
||||||
|
|
||||||
if (m_hScrollBar || m_vScrollBar)
|
if (m_hScrollBar || m_vScrollBar)
|
||||||
XmScrolledWindowSetAreas ((Widget) m_scrolledWindow, (Widget) m_hScrollBar, (Widget) m_vScrollBar, (Widget) m_drawingArea);
|
XmScrolledWindowSetAreas ((Widget) m_scrolledWindow, (Widget) m_hScrollBar, (Widget) m_vScrollBar, (Widget) m_drawingArea);
|
||||||
|
|
||||||
|
@@ -47,6 +47,7 @@ extern wxList wxPendingDelete;
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
||||||
|
EVT_SIZE(wxDialog::OnSize)
|
||||||
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
||||||
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
||||||
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
||||||
@@ -568,6 +569,16 @@ bool wxDialog::OnClose(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxDialog::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
// if we're using constraints - do use them
|
||||||
|
#if wxUSE_CONSTRAINTS
|
||||||
|
if ( GetAutoLayout() ) {
|
||||||
|
Layout();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
// Compatibility
|
// Compatibility
|
||||||
|
@@ -90,7 +90,6 @@ LIB_CPP_SRC=\
|
|||||||
dcmemory.cpp \
|
dcmemory.cpp \
|
||||||
dcscreen.cpp \
|
dcscreen.cpp \
|
||||||
dialog.cpp \
|
dialog.cpp \
|
||||||
dirdlg.cpp \
|
|
||||||
dnd.cpp \
|
dnd.cpp \
|
||||||
filedlg.cpp \
|
filedlg.cpp \
|
||||||
font.cpp \
|
font.cpp \
|
||||||
@@ -135,6 +134,7 @@ LIB_CPP_SRC=\
|
|||||||
\
|
\
|
||||||
../generic/choicdgg.cpp \
|
../generic/choicdgg.cpp \
|
||||||
../generic/colrdlgg.cpp \
|
../generic/colrdlgg.cpp \
|
||||||
|
../generic/dirdlgg.cpp \
|
||||||
../generic/fontdlgg.cpp \
|
../generic/fontdlgg.cpp \
|
||||||
../generic/gridg.cpp \
|
../generic/gridg.cpp \
|
||||||
../generic/imaglist.cpp \
|
../generic/imaglist.cpp \
|
||||||
@@ -154,6 +154,7 @@ LIB_CPP_SRC=\
|
|||||||
|
|
||||||
# If you're not using the generic ones, you
|
# If you're not using the generic ones, you
|
||||||
# may wish to define platform-specific ones
|
# may wish to define platform-specific ones
|
||||||
|
# dirdlg.cpp \
|
||||||
# treectrl.cpp \
|
# treectrl.cpp \
|
||||||
# listctrl.cpp \
|
# listctrl.cpp \
|
||||||
# imaglist.cpp \
|
# imaglist.cpp \
|
||||||
|
@@ -2117,8 +2117,8 @@ void wxResourceEditorFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void wxResourceEditorFrame::OnExit(wxCommandEvent& WXUNUSED(event))
|
void wxResourceEditorFrame::OnExit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
manager->Clear(TRUE, FALSE) ;
|
manager->Clear(TRUE, FALSE) ;
|
||||||
this->Close();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxResourceEditorFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void wxResourceEditorFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
|
@@ -1371,13 +1371,13 @@ wxProperty *wxRadioBoxPropertyInfo::GetProperty(wxString& name)
|
|||||||
if (name == "orientation")
|
if (name == "orientation")
|
||||||
{
|
{
|
||||||
wxString orient;
|
wxString orient;
|
||||||
if (m_propertyWindow->GetWindowStyleFlag() & wxRA_HORIZONTAL)
|
if (m_propertyWindow->GetWindowStyleFlag() & wxRA_SPECIFY_COLS)
|
||||||
orient = "wxRA_HORIZONTAL";
|
orient = "wxRA_SPECIFY_COLS";
|
||||||
else
|
else
|
||||||
orient = "wxRA_VERTICAL";
|
orient = "wxRA_SPECIFY_ROWS";
|
||||||
|
|
||||||
return new wxProperty("orientation", orient, "string",
|
return new wxProperty("orientation", orient, "string",
|
||||||
new wxStringListValidator(new wxStringList("wxRA_HORIZONTAL", "wxRA_VERTICAL",
|
new wxStringListValidator(new wxStringList("wxRA_SPECIFY_COLS", "wxRA_SPECIFY_ROWS",
|
||||||
NULL)));
|
NULL)));
|
||||||
}
|
}
|
||||||
else if (name == "values")
|
else if (name == "values")
|
||||||
@@ -1405,17 +1405,17 @@ bool wxRadioBoxPropertyInfo::SetProperty(wxString& name, wxProperty *property)
|
|||||||
{
|
{
|
||||||
long windowStyle = radioBox->GetWindowStyleFlag();
|
long windowStyle = radioBox->GetWindowStyleFlag();
|
||||||
wxString val(property->GetValue().StringValue());
|
wxString val(property->GetValue().StringValue());
|
||||||
if (val == "wxRA_HORIZONTAL")
|
if (val == "wxRA_SPECIFY_COLS")
|
||||||
{
|
{
|
||||||
if (windowStyle & wxRA_VERTICAL)
|
if (windowStyle & wxRA_SPECIFY_ROWS)
|
||||||
windowStyle -= wxRA_VERTICAL;
|
windowStyle -= wxRA_SPECIFY_ROWS;
|
||||||
windowStyle |= wxRA_HORIZONTAL;
|
windowStyle |= wxRA_SPECIFY_COLS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (windowStyle & wxRA_HORIZONTAL)
|
if (windowStyle & wxRA_SPECIFY_COLS)
|
||||||
windowStyle -= wxRA_HORIZONTAL;
|
windowStyle -= wxRA_SPECIFY_COLS;
|
||||||
windowStyle |= wxRA_VERTICAL;
|
windowStyle |= wxRA_SPECIFY_ROWS;
|
||||||
}
|
}
|
||||||
radioBox->SetWindowStyleFlag(windowStyle);
|
radioBox->SetWindowStyleFlag(windowStyle);
|
||||||
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(radioBox);
|
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(radioBox);
|
||||||
|
@@ -97,6 +97,8 @@ int g_WindowStylesRadioButtonCount = sizeof(g_WindowStylesRadioButton)/sizeof(wx
|
|||||||
|
|
||||||
/* wxRadioBox */
|
/* wxRadioBox */
|
||||||
static wxWindowStylePair g_WindowStylesRadioBox[] = {
|
static wxWindowStylePair g_WindowStylesRadioBox[] = {
|
||||||
|
{ "wxRA_SPECIFY_COLS", wxRA_SPECIFY_COLS },
|
||||||
|
{ "wxRA_SPECIFY_ROWS", wxRA_SPECIFY_ROWS },
|
||||||
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
|
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
|
||||||
{ "wxRA_VERTICAL", wxRA_VERTICAL }
|
{ "wxRA_VERTICAL", wxRA_VERTICAL }
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user