More Motif stuff incl. beginnings of wxToolBar
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -198,7 +198,7 @@ public:
|
||||
inline WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; }
|
||||
virtual WXPixmap GetLabelPixmap(WXWidget w) ;
|
||||
virtual WXPixmap GetArmPixmap(WXWidget w) ;
|
||||
virtual WXPixmap GetInsensPixmap(WXWidget w) ;
|
||||
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
|
||||
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
@@ -44,6 +44,11 @@ class WXDLLEXPORT wxButton: public wxControl
|
||||
|
||||
virtual void SetDefault();
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -45,6 +45,11 @@ class WXDLLEXPORT wxCheckBox: public wxControl
|
||||
virtual void SetValue(bool);
|
||||
virtual bool GetValue() const ;
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
||||
|
@@ -67,6 +67,10 @@ class WXDLLEXPORT wxChoice: public wxControl
|
||||
|
||||
void SetFocus();
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const { return m_formWidget; }
|
||||
WXWidget GetMainWidget() const { return m_buttonWidget; }
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
// Colour
|
||||
class WXDLLEXPORT wxColour : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
public:
|
||||
// ctors
|
||||
// default
|
||||
@@ -53,10 +54,17 @@ public:
|
||||
|
||||
// accessors
|
||||
bool Ok() const {return m_isInit; }
|
||||
unsigned char Red() const { return m_red; }
|
||||
unsigned char Green() const { return m_green; }
|
||||
unsigned char Blue() const { return m_blue; }
|
||||
|
||||
int GetPixel() const { return m_pixel; };
|
||||
void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
|
||||
|
||||
inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
|
||||
|
||||
inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
|
||||
|
||||
// Allocate a colour, or nearest colour, using the given display.
|
||||
// If realloc is TRUE, ignore the existing pixel, otherwise just return
|
||||
// the existing one.
|
||||
@@ -67,6 +75,8 @@ public:
|
||||
|
||||
int AllocColour(WXDisplay* display, bool realloc = FALSE);
|
||||
|
||||
void InitFromName(const wxString& col);
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
|
@@ -72,6 +72,11 @@ class WXDLLEXPORT wxComboBox: public wxChoice
|
||||
}
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -93,7 +93,10 @@ public:
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
//// Motif-specific
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
inline WXWidget GetTopWidget() const { return m_mainWidget; }
|
||||
inline WXWidget GetClientWidget() const { return m_mainWidget; }
|
||||
|
||||
|
@@ -144,8 +144,10 @@ public:
|
||||
virtual void CaptureMouse();
|
||||
virtual void ReleaseMouse();
|
||||
|
||||
//// Motif-specific
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetMenuBarWidget() const ;
|
||||
inline WXWidget GetShellWidget() const { return m_frameShell; }
|
||||
inline WXWidget GetWorkAreaWidget() const { return m_workArea; }
|
||||
|
@@ -60,6 +60,11 @@ class WXDLLEXPORT wxGauge: public wxControl
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
|
@@ -89,6 +89,10 @@ class WXDLLEXPORT wxListBox: public wxControl
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const;
|
||||
|
||||
protected:
|
||||
|
@@ -69,7 +69,7 @@ public:
|
||||
// toolbar(s), don't call SetToolBar.
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
// Get the active MDI child window (Windows only)
|
||||
// Get the active MDI child window
|
||||
wxMDIChildFrame *GetActiveChild() const ;
|
||||
|
||||
// Get the client window
|
||||
@@ -86,9 +86,13 @@ public:
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
// Implementation
|
||||
inline void SetActiveChild(wxMDIChildFrame* child) { m_activeChild = child; }
|
||||
|
||||
protected:
|
||||
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
wxMDIClientWindow* m_clientWindow;
|
||||
wxMDIChildFrame* m_activeChild;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
@@ -144,6 +148,8 @@ public:
|
||||
void BuildClientArea(WXWidget parent);
|
||||
inline WXWidget GetTopWidget() const { return m_mainWidget; };
|
||||
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
|
||||
virtual void OnRaise();
|
||||
virtual void OnLower();
|
||||
|
||||
protected:
|
||||
wxXsMDIWindow* m_mdiWindow ;
|
||||
|
@@ -162,6 +162,11 @@ public:
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool DoPhase(int nPhase);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
@@ -35,6 +35,8 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Widget widget,
|
||||
bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Widget widget, XEvent *xevent);
|
||||
int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap);
|
||||
Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap );
|
||||
extern XColor g_itemColors[];
|
||||
extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
|
||||
|
||||
#define wxNO_COLORS 0x00
|
||||
#define wxBACK_COLORS 0x01
|
||||
|
@@ -68,6 +68,10 @@ public:
|
||||
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const { return m_formWidget; }
|
||||
WXWidget GetLabelWidget() const { return m_labelWidget; }
|
||||
inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
|
||||
|
@@ -48,6 +48,10 @@ public:
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const { return m_formWidget; }
|
||||
WXWidget GetLabelWidget() const { return m_labelWidget; }
|
||||
|
||||
|
@@ -56,6 +56,11 @@ public:
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
int m_pageSize;
|
||||
int m_viewSize;
|
||||
|
@@ -76,6 +76,12 @@ public:
|
||||
void SetTick(int tickPos) ;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
int m_rangeMin;
|
||||
int m_rangeMax;
|
||||
|
@@ -64,6 +64,11 @@ class WXDLLEXPORT wxSpinButton: public wxControl
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
int m_min;
|
||||
int m_max;
|
||||
|
@@ -56,6 +56,11 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
|
||||
|
@@ -51,7 +51,10 @@ class WXDLLEXPORT wxStaticBox: public wxControl
|
||||
void SetLabel(const wxString& label);
|
||||
wxString GetLabel() const;
|
||||
|
||||
// Motif-specific
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const { return m_formWidget; }
|
||||
WXWidget GetLabelWidget() const { return m_labelWidget; }
|
||||
|
||||
|
@@ -46,6 +46,11 @@ class WXDLLEXPORT wxStaticText: public wxControl
|
||||
// operations
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -124,11 +124,12 @@ public:
|
||||
void OnChar(wxKeyEvent& event);
|
||||
// void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
// Implementation
|
||||
// --------------
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
//// Motif-specific
|
||||
// Implementation
|
||||
virtual void ChangeFont();
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
inline void SetModified(bool mod) { m_modified = mod; }
|
||||
virtual WXWidget GetTopWidget() const;
|
||||
|
||||
|
@@ -22,6 +22,8 @@ class WXDLLEXPORT wxTimer: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTimer)
|
||||
|
||||
friend void wxTimerCallback (wxTimer * timer);
|
||||
|
||||
public:
|
||||
wxTimer();
|
||||
~wxTimer();
|
||||
|
@@ -32,7 +32,9 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
|
||||
|
||||
inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
||||
const wxString& name = wxToolBarNameStr)
|
||||
const wxString& name = wxToolBarNameStr):
|
||||
m_widgets(wxKEY_INTEGER)
|
||||
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
@@ -69,6 +71,8 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
|
||||
bool Realize() { return CreateTools(); };
|
||||
|
||||
protected:
|
||||
// List of widgets in the toolbar, indexed by tool index
|
||||
wxList m_widgets;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@@ -311,11 +311,11 @@ public:
|
||||
void SetConstraints(wxLayoutConstraints *c);
|
||||
|
||||
// Set/get window background colour
|
||||
inline virtual void SetBackgroundColour(const wxColour& col);
|
||||
virtual void SetBackgroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetBackgroundColour() const;
|
||||
|
||||
// Set/get window foreground colour
|
||||
inline virtual void SetForegroundColour(const wxColour& col);
|
||||
virtual void SetForegroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetForegroundColour() const;
|
||||
|
||||
// Get the default button, if there is one
|
||||
@@ -488,8 +488,15 @@ public:
|
||||
virtual WXRegion GetPaintRegion() const { return m_paintRegion; }
|
||||
|
||||
// Change properties
|
||||
virtual void ChangeColour(WXWidget widget);
|
||||
virtual void ChangeFont(WXWidget widget);
|
||||
virtual void ChangeFont(); // Change to the current font (often overridden)
|
||||
virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
|
||||
virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
|
||||
// These to be overridden as needed (may change several widgets)
|
||||
virtual void ChangeBackgroundColour(); // Change background and foreground colour using current
|
||||
// background colour setting (Motif generates
|
||||
// foreground based on background)
|
||||
virtual void ChangeForegroundColour(); // Change foreground colour using current
|
||||
// foreground colour setting
|
||||
|
||||
// Adds the widget to the hash table and adds event handlers.
|
||||
bool AttachWidget (wxWindow* parent, WXWidget mainWidget,
|
||||
@@ -595,9 +602,7 @@ inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHan
|
||||
inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; }
|
||||
inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; }
|
||||
inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; }
|
||||
inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
|
||||
inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; };
|
||||
inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; };
|
||||
inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; };
|
||||
|
||||
inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; }
|
||||
|
Reference in New Issue
Block a user