wx-config.in
mkinstalldirs
-makeenvs/*.env
+src/makeenvs/*.env
src/Makefile
src/Makefile.in
distrib/msw/*.rsp
distrib/msw/*.bat
+tools/gettext/xgettext.exe
+tools/gettext/msgfmt.exe
+tools/gettext/msgunfmt.exe
+
src/makeb32.env
src/makebcc.env
src/makemsw.env
docs/html/odbc/*.htm
+docs/html/gettext/*.htm
+
\membersection{wxFrame::IsIconized}\label{wxframeisiconized}
-\func{bool}{IsIconized}{\void}
+\constfunc{bool}{IsIconized}{\void}
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}
\func{void}{LoadAccelerators}{\param{const wxString\& }{table}}
\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
-\twocolitem{\windowstyle{wxRA\_HORIZONTAL}}{Lays the radiobox out in rows.}
-\twocolitem{\windowstyle{wxRA\_VERTICAL}}{Lays the radiobox out in columns.}
+\twocolitem{\windowstyle{wxRA\_SPECIFY\_ROWS}}{The major dimension parameter refers to the
+maximum number of rows.}
+\twocolitem{\windowstyle{wxRA\_SPECIFY\_COLS}}{The major dimension parameter refers to the
+maximum number of columns.}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
\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{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 wxString\& }{name = ``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.}
\docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.}
\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{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 wxString\& }{name = ``radioBox"}}
with gcc) and the sample is now partially working. Some work
on the scrollbars is required.
- wxListCtrl assumed that one of the args to GetClientSize can be NULL:
- corrected.
\ No newline at end of file
+ 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.
#include "wx/defs.h"
#include "wx/event.h"
+#include "wx/font.h"
+#include "wx/gdicmn.h"
class WXDLLEXPORT wxMenuItem;
class WXDLLEXPORT wxMenuBar;
void DestroyMenu(bool full);
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:
wxFunction m_callback;
wxMenu* m_topLevelMenu ;
wxMenu* m_menuParent;
bool m_ownedByMenuBar;
+ wxColour m_foregroundColour;
+ wxColour m_backgroundColour;
+ wxFont m_font;
};
// ----------------------------------------------------------------------------
// Destroy menubar, but keep data structures intact so we can recreate it.
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:
wxEvtHandler * m_eventHandler;
int m_menuCount;
//// Motif-specific
WXWidget m_mainWidget;
+ wxColour m_foregroundColour;
+ wxColour m_backgroundColour;
+ wxFont m_font;
};
#endif // _WX_MENU_H_
extern XColor g_itemColors[];
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 wxBACK_COLORS 0x01
#define wxFORE_COLORS 0x02
void SetTitle(const wxString& title);
wxString GetTitle() const ;
+ void OnSize(wxSizeEvent& event);
bool OnClose();
void OnCharHook(wxKeyEvent& event);
void OnPaint(wxPaintEvent& event);
panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet 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 = 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");
(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) );
--- /dev/null
+#
+# 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
return (void *)malloc(size);
}
- char * buf = (char *) malloc(wxDebugContext::TotSize (size));
+ int totSize = wxDebugContext::TotSize (size);
+ char * buf = (char *) malloc(totSize);
if (!buf) {
wxLogDebug("Call to malloc (%ld) failed.", (long)size);
return 0;
/* wxRadioBox/wxRadioButton */
{ "wxRB_GROUP", wxRB_GROUP },
+ { "wxRA_SPECIFY_COLS", wxRA_SPECIFY_COLS },
+ { "wxRA_SPECIFY_ROWS", wxRA_SPECIFY_ROWS },
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
{ "wxRA_VERTICAL", wxRA_VERTICAL },
IMPLEMENT_DYNAMIC_CLASS(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_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
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.SetEventObject( m_parent );
- m_parent->GetEventHandler()->ProcessEvent( le );
+ le.SetEventObject( GetParent() );
+ GetParent()->GetEventHandler()->ProcessEvent( le );
/*
if (event.KeyCode() == WXK_TAB)
SetValidator(validator);
m_noStrings = n;
m_windowStyle = style;
- m_backgroundColour = parent->GetBackgroundColour();
+ // m_backgroundColour = parent->GetBackgroundColour();
+ m_backgroundColour = * wxWHITE;
m_foregroundColour = parent->GetForegroundColour();
if (parent) parent->AddChild(this);
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);
- 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;
// We don't want margins, since there is enough elsewhere.
wxModalShowingStack.Insert((wxObject *)TRUE);
m_modalShowing = TRUE;
- XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
+ // XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
+
XEvent event;
// Loop until we signal that the dialog should be closed
*/
}
-void wxDialog::ChangeFont(bool WXUNUSED(keepOriginalSize))
+void wxDialog::ChangeFont(bool keepOriginalSize)
{
- // TODO
+ wxWindow::ChangeFont(keepOriginalSize);
}
void wxDialog::ChangeBackgroundColour()
{
- // TODO
+ if (GetMainWidget())
+ DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour);
}
void wxDialog::ChangeForegroundColour()
{
- // TODO
+ if (GetMainWidget())
+ DoChangeForegroundColour(GetMainWidget(), m_foregroundColour);
}
m_windowStyle = style;
m_noItems = n;
m_selected = 0;
- m_backgroundColour = parent->GetBackgroundColour();
+ // m_backgroundColour = parent->GetBackgroundColour();
+ m_backgroundColour = * wxWHITE;
m_foregroundColour = parent->GetForegroundColour();
SetName(name);
/* TODO: should scrollbars be affected? Should probably have separate
* 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);
}
dcmemory.cpp \
dcscreen.cpp \
dialog.cpp \
- dirdlg.cpp \
dnd.cpp \
filedlg.cpp \
font.cpp \
\
../generic/choicdgg.cpp \
../generic/colrdlgg.cpp \
+ ../generic/dirdlgg.cpp \
../generic/fontdlgg.cpp \
../generic/gridg.cpp \
../generic/helpext.cpp \
# If you're not using the generic ones, you
# may wish to define platform-specific ones
+# dirdlg.cpp \
# treectrl.cpp \
# listctrl.cpp \
# imaglist.cpp \
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/frame.h"
+#include "wx/settings.h"
#include <Xm/Label.h>
#include <Xm/LabelG.h>
Append(ID_SEPARATOR, m_title) ;
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);
}
m_titles = NULL;
m_menuBarFrame = 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[])
for ( i = 0; i < n; i++ )
m_titles[i] = titles[i];
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()
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);
XtRealizeWidget ((Widget) menuBarW);
XtManageChild ((Widget) menuBarW);
item->CreateItem (menu, menuBar, topMenu);
}
+ SetBackgroundColour(m_backgroundColour);
+ SetForegroundColour(m_foregroundColour);
+ SetFont(m_font);
+
return buttonWidget;
}
*it = (wxMenuItem*) 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);
+}
+
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()
{
- // 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()
{
- // 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,
XmNrightAttachment, XmATTACH_FORM,
NULL);
- m_mainWidget = (Widget) formWidget;
+ m_mainWidget = (WXWidget) frameWidget;
+ m_formWidget = (WXWidget) formWidget;
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();
return TRUE;
m_modified = FALSE;
m_processedDefault = FALSE;
m_fileName = "";
- m_backgroundColour = parent->GetBackgroundColour();
+ // m_backgroundColour = parent->GetBackgroundColour();
+ m_backgroundColour = * wxWHITE;
m_foregroundColour = parent->GetForegroundColour();
SetName(name);
{
wxWindow::ChangeBackgroundColour();
- Widget parent = XtParent ((Widget) m_mainWidget);
- Widget hsb, vsb;
+ /* TODO: should scrollbars be affected? Should probably have separate
+ * 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,
XmNverticalScrollBar, &vsb,
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
- * 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);
+ DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
+ }
}
void wxTextCtrl::ChangeForegroundColour()
{
wxWindow::ChangeForegroundColour();
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ Widget parent = XtParent ((Widget) m_mainWidget);
+ Widget hsb, vsb;
- Widget parent = XtParent ((Widget) m_mainWidget);
- Widget hsb, vsb;
-
- XtVaGetValues (parent,
+ XtVaGetValues (parent,
XmNhorizontalScrollBar, &hsb,
XmNverticalScrollBar, &vsb,
NULL);
- /* TODO: should scrollbars be affected? Should probably have separate
- * function to change them (by default, taken from wxSystemSettings)
- if (hsb)
- DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
- if (vsb)
- DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
- */
- DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
+ /* TODO: should scrollbars be affected? Should probably have separate
+ * function to change them (by default, taken from wxSystemSettings)
+ if (hsb)
+ DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
+ if (vsb)
+ DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
+ */
+ DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
+ }
}
static void wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)
(XtPointer) this);
}
+ DoChangeBackgroundColour((WXWidget) button, m_backgroundColour, TRUE);
+
// For each button, if there is a mask, we must create
// a new wxBitmap that has the correct background colour
// for the button. Otherwise the background will just be
}
+// 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);
+}
+
+
NULL);
m_hScrollBar = (WXWidget) hScrollBar;
+
+ wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
+ DoChangeBackgroundColour(m_hScrollBar, backgroundColour, TRUE);
+
m_hScroll = TRUE;
}
if (m_windowStyle & wxVSCROLL)
NULL);
m_vScrollBar = (WXWidget) vScrollBar;
+ wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
+ DoChangeBackgroundColour(m_vScrollBar, backgroundColour, 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)
XmScrolledWindowSetAreas ((Widget) m_scrolledWindow, (Widget) m_hScrollBar, (Widget) m_vScrollBar, (Widget) m_drawingArea);
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
+ EVT_SIZE(wxDialog::OnSize)
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
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)
{
// Compatibility
dcmemory.cpp \
dcscreen.cpp \
dialog.cpp \
- dirdlg.cpp \
dnd.cpp \
filedlg.cpp \
font.cpp \
\
../generic/choicdgg.cpp \
../generic/colrdlgg.cpp \
+ ../generic/dirdlgg.cpp \
../generic/fontdlgg.cpp \
../generic/gridg.cpp \
../generic/imaglist.cpp \
# If you're not using the generic ones, you
# may wish to define platform-specific ones
+# dirdlg.cpp \
# treectrl.cpp \
# listctrl.cpp \
# imaglist.cpp \
void wxResourceEditorFrame::OnExit(wxCommandEvent& WXUNUSED(event))
{
- manager->Clear(TRUE, FALSE) ;
- this->Close();
+ manager->Clear(TRUE, FALSE) ;
+ this->Destroy();
}
void wxResourceEditorFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
if (name == "orientation")
{
wxString orient;
- if (m_propertyWindow->GetWindowStyleFlag() & wxRA_HORIZONTAL)
- orient = "wxRA_HORIZONTAL";
+ if (m_propertyWindow->GetWindowStyleFlag() & wxRA_SPECIFY_COLS)
+ orient = "wxRA_SPECIFY_COLS";
else
- orient = "wxRA_VERTICAL";
+ orient = "wxRA_SPECIFY_ROWS";
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)));
}
else if (name == "values")
{
long windowStyle = radioBox->GetWindowStyleFlag();
wxString val(property->GetValue().StringValue());
- if (val == "wxRA_HORIZONTAL")
+ if (val == "wxRA_SPECIFY_COLS")
{
- if (windowStyle & wxRA_VERTICAL)
- windowStyle -= wxRA_VERTICAL;
- windowStyle |= wxRA_HORIZONTAL;
+ if (windowStyle & wxRA_SPECIFY_ROWS)
+ windowStyle -= wxRA_SPECIFY_ROWS;
+ windowStyle |= wxRA_SPECIFY_COLS;
}
else
{
- if (windowStyle & wxRA_HORIZONTAL)
- windowStyle -= wxRA_HORIZONTAL;
- windowStyle |= wxRA_VERTICAL;
+ if (windowStyle & wxRA_SPECIFY_COLS)
+ windowStyle -= wxRA_SPECIFY_COLS;
+ windowStyle |= wxRA_SPECIFY_ROWS;
}
radioBox->SetWindowStyleFlag(windowStyle);
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(radioBox);
/* wxRadioBox */
static wxWindowStylePair g_WindowStylesRadioBox[] = {
+ { "wxRA_SPECIFY_COLS", wxRA_SPECIFY_COLS },
+ { "wxRA_SPECIFY_ROWS", wxRA_SPECIFY_ROWS },
{ "wxRA_HORIZONTAL", wxRA_HORIZONTAL },
{ "wxRA_VERTICAL", wxRA_VERTICAL }
};