system.list
bin
+.gdb_history
+Test
void SetSingleStyle( long style, bool add = TRUE ) ;
void SetWindowStyleFlag(long style);
void RecreateWindow(void) {};
- long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE);
+ long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const;
wxImageList *GetImageList(int which);
void SetImageList(wxImageList *imageList, int which) ;
bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
public:
wxBitmapButton(void);
- wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
+ inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr)
+ {
+ Create(parent, id, bitmap, pos, size, style, validator, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
void SetDefault(void);
void SetLabel( const wxString &label );
wxString GetLabel(void) const;
public:
wxButton(void);
- wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
+ inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
void SetDefault(void);
void SetLabel( const wxString &label );
};
public:
wxCheckBox(void);
- wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxCheckBoxNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxCheckBoxNameStr );
+ inline wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+ bool Create( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr );
void SetValue( bool state );
bool GetValue(void) const;
};
public:
wxChoice(void);
- wxChoice( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxChoiceNameStr );
+ inline wxChoice( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr )
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxChoiceNameStr );
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr );
void Append( const wxString &item );
void Clear(void);
int FindString( const wxString &string ) const;
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
- Create(parent, id, value, pos, size, n, choices, style, name);
+ Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
-
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// List functions
virtual wxString GetTitle() const { return m_title; }
virtual void SetIcon( const wxIcon &icon );
+ void Iconize( bool WXUNUSED(iconize)) { }
+ bool IsIconized(void) const { return FALSE; }
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
public:
inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
- inline wxGauge(wxWindow *parent, wxWindowID id,
+ inline wxGauge( wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
- const wxString& name = wxGaugeNameStr)
- {
- Create(parent, id, range, pos, size, style, name);
- };
-
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr )
+ {
+ Create(parent, id, range, pos, size, style, validator, name);
+ }
+ bool Create( wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
-
- void SetShadowWidth( int WXUNUSED(w) ) {};
- void SetBezelFace( int WXUNUSED(w) ) {};
- void SetRange( int r );
- void SetValue( int pos );
- int GetShadowWidth(void) const { return 0; };
- int GetBezelFace(void) const { return 0; };
- int GetRange(void) const;
- int GetValue(void) const;
-
- // Are we a Win95/GTK progress bar, or a normal gauge?
- inline bool GetProgressBar(void) const { return m_useProgressBar; }
+ void SetShadowWidth( int WXUNUSED(w) ) {};
+ void SetBezelFace( int WXUNUSED(w) ) {};
+ void SetRange( int r );
+ void SetValue( int pos );
+ int GetShadowWidth(void) const { return 0; };
+ int GetBezelFace(void) const { return 0; };
+ int GetRange(void) const;
+ int GetValue(void) const;
+
+ // Are we a Win95/GTK progress bar, or a normal gauge?
+ inline bool GetProgressBar(void) const { return m_useProgressBar; }
protected:
public:
wxListBox(void);
- wxListBox( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxListBoxNameStr );
+ inline wxListBox( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr )
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxListBoxNameStr );
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr );
void Append( const wxString &item );
void Append( const wxString &item, char *clientData );
void Clear(void);
public:
// construction
- wxMenu( const wxString &title = "" );
+ wxMenu( const wxString& title = wxEmptyString, const wxFunction func = NULL );
// operations
// menu creation
// accessors
wxList& GetItems() { return m_items; }
+ inline void Callback(const wxFunction func) { m_callback = func; }
+
+ inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+ inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+
public:
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
void SetInvokingWindow( wxWindow *win );
wxWindow *GetInvokingWindow();
- wxString m_title;
- wxList m_items;
- wxWindow *m_invokingWindow;
+ wxString m_title;
+ wxList m_items;
+ wxWindow *m_invokingWindow;
+ wxFunction m_callback;
+ wxEvtHandler *m_eventHandler;
- GtkWidget *m_menu; // GtkMenu
+ GtkWidget *m_menu; // GtkMenu
};
#endif // __GTKMENUH__
public:
wxRadioBox(void);
- wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxString &name = wxRadioBoxNameStr );
+ inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = wxRadioBoxNameStr )
+ {
+ Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
+ }
bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxString &name = wxRadioBoxNameStr );
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( int n );
int GetSelection(void) const;
class wxRadioButton;
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern const char* wxRadioButtonNameStr;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+class wxRadioButton: public wxControl
+{
+ DECLARE_DYNAMIC_CLASS(wxRadioButton)
+
+ public:
+ inline wxRadioButton(void) {}
+ inline wxRadioButton( wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxRadioButtonNameStr )
+ {
+ Create( parent, id, label, pos, size, style, validator, name );
+ }
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxRadioButtonNameStr );
+ virtual void SetLabel(const wxString& label);
+ virtual void SetValue(bool val);
+ virtual bool GetValue(void) const;
+};
#endif // __GTKRADIOBUTTONH__
public:
wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; };
- wxScrollBar(wxWindow *parent, wxWindowID id,
+ inline wxScrollBar( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
- const wxString& name = wxScrollBarNameStr );
- ~wxScrollBar(void);
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxScrollBarNameStr )
+ {
+ Create( parent, id, pos, size, style, validator, name );
+ }
+ bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
- const wxString& name = wxScrollBarNameStr);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxScrollBarNameStr );
+ ~wxScrollBar(void);
int GetPosition(void) const;
int GetThumbSize() const;
int GetPageSize() const;
public:
wxSlider(void);
- wxSlider( wxWindow *parent, wxWindowID id,
+ inline wxSlider( wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name = wxSliderNameStr);
- ~wxSlider(void);
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr )
+ {
+ Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name );
+ }
+ ~wxSlider(void);
+ bool Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name = wxSliderNameStr);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr );
virtual int GetValue(void) const;
virtual void SetValue( int );
void GetSize( int *x, int *y ) const;
wxTextCtrl();
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int style = 0, const wxString &name = wxTextCtrlNameStr );
+ int style = 0, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = wxTextCtrlNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int style = 0, const wxString &name = wxTextCtrlNameStr );
+ int style = 0, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = wxTextCtrlNameStr );
wxString GetValue() const;
void SetValue( const wxString &value );
void WriteText( const wxString &text );
class wxLayoutConstraints;
class wxSizer;
+class wxResourceTable;
+class wxItemResource;
class wxWindow;
class wxCanvas;
{
public:
wxWindow();
- wxWindow( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxPanelNameStr );
- bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxPanelNameStr );
+ inline wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ Create(parent, id, pos, size, style, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
virtual ~wxWindow();
+
+ virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+ virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
+
bool Close( bool force = FALSE );
virtual bool Destroy();
virtual bool DestroyChildren();
wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
virtual wxValidator *GetValidator();
- virtual void SetValidator( wxValidator *validator );
+ virtual void SetValidator( const wxValidator &validator );
bool IsBeingDeleted();
virtual wxColour GetBackgroundColour() const;
virtual void SetBackgroundColour( const wxColour &colour );
+ virtual wxColour GetForegroundColour() const;
+ virtual void SetForegroundColour( const wxColour &colour );
virtual void SetDefaultBackgroundColour( const wxColour& col )
{ m_defaultBackgroundColour = col; };
public:
wxBitmapButton(void);
- wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
+ inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr)
+ {
+ Create(parent, id, bitmap, pos, size, style, validator, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
void SetDefault(void);
void SetLabel( const wxString &label );
wxString GetLabel(void) const;
public:
wxButton(void);
- wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxButtonNameStr );
+ inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
void SetDefault(void);
void SetLabel( const wxString &label );
};
public:
wxCheckBox(void);
- wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxCheckBoxNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxCheckBoxNameStr );
+ inline wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+ bool Create( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr );
void SetValue( bool state );
bool GetValue(void) const;
};
public:
wxChoice(void);
- wxChoice( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxChoiceNameStr );
+ inline wxChoice( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr )
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxChoiceNameStr );
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr );
void Append( const wxString &item );
void Clear(void);
int FindString( const wxString &string ) const;
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
- Create(parent, id, value, pos, size, n, choices, style, name);
+ Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
-
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// List functions
virtual wxString GetTitle() const { return m_title; }
virtual void SetIcon( const wxIcon &icon );
+ void Iconize( bool WXUNUSED(iconize)) { }
+ bool IsIconized(void) const { return FALSE; }
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
public:
inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
- inline wxGauge(wxWindow *parent, wxWindowID id,
+ inline wxGauge( wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
- const wxString& name = wxGaugeNameStr)
- {
- Create(parent, id, range, pos, size, style, name);
- };
-
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr )
+ {
+ Create(parent, id, range, pos, size, style, validator, name);
+ }
+ bool Create( wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
-
- void SetShadowWidth( int WXUNUSED(w) ) {};
- void SetBezelFace( int WXUNUSED(w) ) {};
- void SetRange( int r );
- void SetValue( int pos );
- int GetShadowWidth(void) const { return 0; };
- int GetBezelFace(void) const { return 0; };
- int GetRange(void) const;
- int GetValue(void) const;
-
- // Are we a Win95/GTK progress bar, or a normal gauge?
- inline bool GetProgressBar(void) const { return m_useProgressBar; }
+ void SetShadowWidth( int WXUNUSED(w) ) {};
+ void SetBezelFace( int WXUNUSED(w) ) {};
+ void SetRange( int r );
+ void SetValue( int pos );
+ int GetShadowWidth(void) const { return 0; };
+ int GetBezelFace(void) const { return 0; };
+ int GetRange(void) const;
+ int GetValue(void) const;
+
+ // Are we a Win95/GTK progress bar, or a normal gauge?
+ inline bool GetProgressBar(void) const { return m_useProgressBar; }
protected:
public:
wxListBox(void);
- wxListBox( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxListBoxNameStr );
+ inline wxListBox( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr )
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0, const wxString &name = wxListBoxNameStr );
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr );
void Append( const wxString &item );
void Append( const wxString &item, char *clientData );
void Clear(void);
public:
// construction
- wxMenu( const wxString &title = "" );
+ wxMenu( const wxString& title = wxEmptyString, const wxFunction func = NULL );
// operations
// menu creation
// accessors
wxList& GetItems() { return m_items; }
+ inline void Callback(const wxFunction func) { m_callback = func; }
+
+ inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+ inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+
public:
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
void SetInvokingWindow( wxWindow *win );
wxWindow *GetInvokingWindow();
- wxString m_title;
- wxList m_items;
- wxWindow *m_invokingWindow;
+ wxString m_title;
+ wxList m_items;
+ wxWindow *m_invokingWindow;
+ wxFunction m_callback;
+ wxEvtHandler *m_eventHandler;
- GtkWidget *m_menu; // GtkMenu
+ GtkWidget *m_menu; // GtkMenu
};
#endif // __GTKMENUH__
public:
wxRadioBox(void);
- wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxString &name = wxRadioBoxNameStr );
+ inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = wxRadioBoxNameStr )
+ {
+ Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
+ }
bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxString &name = wxRadioBoxNameStr );
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( int n );
int GetSelection(void) const;
class wxRadioButton;
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern const char* wxRadioButtonNameStr;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+class wxRadioButton: public wxControl
+{
+ DECLARE_DYNAMIC_CLASS(wxRadioButton)
+
+ public:
+ inline wxRadioButton(void) {}
+ inline wxRadioButton( wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxRadioButtonNameStr )
+ {
+ Create( parent, id, label, pos, size, style, validator, name );
+ }
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxRadioButtonNameStr );
+ virtual void SetLabel(const wxString& label);
+ virtual void SetValue(bool val);
+ virtual bool GetValue(void) const;
+};
#endif // __GTKRADIOBUTTONH__
public:
wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; };
- wxScrollBar(wxWindow *parent, wxWindowID id,
+ inline wxScrollBar( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
- const wxString& name = wxScrollBarNameStr );
- ~wxScrollBar(void);
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxScrollBarNameStr )
+ {
+ Create( parent, id, pos, size, style, validator, name );
+ }
+ bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
- const wxString& name = wxScrollBarNameStr);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxScrollBarNameStr );
+ ~wxScrollBar(void);
int GetPosition(void) const;
int GetThumbSize() const;
int GetPageSize() const;
public:
wxSlider(void);
- wxSlider( wxWindow *parent, wxWindowID id,
+ inline wxSlider( wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name = wxSliderNameStr);
- ~wxSlider(void);
- bool Create(wxWindow *parent, wxWindowID id,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr )
+ {
+ Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name );
+ }
+ ~wxSlider(void);
+ bool Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name = wxSliderNameStr);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr );
virtual int GetValue(void) const;
virtual void SetValue( int );
void GetSize( int *x, int *y ) const;
wxTextCtrl();
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int style = 0, const wxString &name = wxTextCtrlNameStr );
+ int style = 0, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = wxTextCtrlNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- int style = 0, const wxString &name = wxTextCtrlNameStr );
+ int style = 0, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = wxTextCtrlNameStr );
wxString GetValue() const;
void SetValue( const wxString &value );
void WriteText( const wxString &text );
class wxLayoutConstraints;
class wxSizer;
+class wxResourceTable;
+class wxItemResource;
class wxWindow;
class wxCanvas;
{
public:
wxWindow();
- wxWindow( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxPanelNameStr );
- bool Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = wxPanelNameStr );
+ inline wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ Create(parent, id, pos, size, style, name);
+ }
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
virtual ~wxWindow();
+
+ virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+ virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
+
bool Close( bool force = FALSE );
virtual bool Destroy();
virtual bool DestroyChildren();
wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
virtual wxValidator *GetValidator();
- virtual void SetValidator( wxValidator *validator );
+ virtual void SetValidator( const wxValidator &validator );
bool IsBeingDeleted();
virtual wxColour GetBackgroundColour() const;
virtual void SetBackgroundColour( const wxColour &colour );
+ virtual wxColour GetForegroundColour() const;
+ virtual void SetForegroundColour( const wxColour &colour );
virtual void SetDefaultBackgroundColour( const wxColour& col )
{ m_defaultBackgroundColour = col; };
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
LIB_CPP_ALL_SRC=$(LIB_CPP_SRC) @GTK_JOYSTICK@ @UNIX_THREAD@
+LIB_C_ALL_SRC=$(LIB_C_SRC) parser.c
+
#define library objects
LIB_OBJ=\
$(LIB_CPP_ALL_SRC:.cpp=.o) \
- $(LIB_C_SRC:.c=.o)
+ $(LIB_C_ALL_SRC:.c=.o)
all::
- -../mkdirs
+ @if test ! -d gtk; then mkdir gtk; fi
+ @if test ! -d qt; then mkdir qt; fi
+ @if test ! -d motif; then mkdir motif; fi
+ @if test ! -d common; then mkdir common; fi
+ @if test ! -d generic; then mkdir generic; fi
+ @if test ! -d png; then mkdir png; fi
+ @if test ! -d zlib; then mkdir zlib; fi
+ @if test ! -d gdk_imlib; then mkdir gdk_imlib; fi
+ @if test ! -d iodbc; then mkdir iodbc; fi
clean::
$(RM) -rf gtk
$(RM) -rf zlib
$(RM) -rf gdk_imlib
$(RM) -rf iodbc
+ @$(RM) lexer.c parser.c
#additional things needed for compile
ADD_COMPILE= \
# include the definitions now
include ../../template.mak
+
+# things for the prolog stuff
+
+parser.c: ../common/parser.y lexer.c
+ @if test ! -f parser.y; then \
+ cp -f ../common/parser.y . ; \
+ fi
+ @$(YACC) parser.y
+ @sed -e "s/y.tab.c/parser.y/g" < y.tab.c | \
+ sed -e "s/BUFSIZ/5000/g" | \
+ sed -e "s/YYLMAX 200/YYLMAX 5000/g" | \
+ sed -e "s/yy/PROIO_yy/g" | \
+ sed -e "s/input/PROIO_input/g" | \
+ sed -e "s/unput/PROIO_unput/g" > parser.c
+ @$(RM) y.tab.c
+ @$(RM) parser.y
+
+lexer.c: ../common/lexer.l
+ @if test ! -f lexer.l; then \
+ cp -f ../common/lexer.l . ;\
+ fi
+ @$(LEX) lexer.l
+ @sed -e "s/lex.yy.c/lexer.l/g" < lex.yy.c | \
+ sed -e "s/yy/PROIO_yy/g" | \
+ sed -e "s/input/PROIO_input/g" | \
+ sed -e "s/unput/PROIO_unput/g" > lexer.c
+ @$(RM) lex.yy.c
+ @$(RM) lexer.l
+
+clean::
+
\ No newline at end of file
%%
+#ifdef __WXGTK__
+#include "lexer.c"
+#else
#include "../common/lex_yy.c"
+#endif
/*
void yyerror(s)
#include "wx/menu.h"
#include "wx/stattext.h"
#include "wx/button.h"
+#include "wx/bmpbuttn.h"
#include "wx/radiobox.h"
#include "wx/listbox.h"
#include "wx/choice.h"
#include "wx/gauge.h"
#endif
#include "wx/textctrl.h"
-#include "wx/msgbxdlg.h"
+#include "wx/msgdlg.h"
+#include "wx/intl.h"
#endif
#if USE_SCROLLBAR
break;
}
#endif
-#ifdef __X__
+#ifdef __WXGTK__
case RESOURCE_PLATFORM_X:
{
if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
{
case wxBITMAP_TYPE_XBM_DATA:
{
-#ifdef __X__
+#ifdef __WXGTK__
wxItemResource *item = table->FindResource(name);
if (!item)
{
}
case wxBITMAP_TYPE_XPM_DATA:
{
-#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
break;
}
#endif
-#ifdef __X__
+#ifdef __WXGTK__
case RESOURCE_PLATFORM_X:
{
if (!optResource && ((noColours == 0) || (noColours <= thisNoColours)))
{
case wxBITMAP_TYPE_XBM_DATA:
{
-#ifdef __X__
+#ifdef __WXGTK__
wxItemResource *item = table->FindResource(name);
if (!item)
{
"Forgot to use wxResourceLoadIconData?"), name);
return NULL;
}
- icon = new wxIcon((char *)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
+ icon = new wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
#else
wxLogWarning(_("No XBM facility available!"));
#endif
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
-#if (defined(__X__) && USE_XPM_IN_X) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
}
default:
{
+#ifdef __WXGTK__
+ wxLogWarning(_("Icon resource specification %s not found."), resource);
+#else
icon = new wxIcon(name, bitmapType);
+#endif
break;
}
}
#endif
#ifndef WX_PRECOMP
-#include "wx.h"
+#include "wx/wx.h"
#endif
#include "wx/validate.h"
return 0;
};
-long wxListCtrl::GetNextItem( long item, int geom, int state )
+long wxListCtrl::GetNextItem( long item, int geom, int state ) const
{
return m_mainWin->GetNextItem( item, geom, state );
};
common/odbc.cpp \
common/postscrp.cpp \
common/prntbase.cpp \
+ common/resource.cpp \
common/serbase.cpp \
common/string.cpp \
common/textfile.cpp \
common/mstream.cpp \
common/zstream.cpp \
common/objstrm.cpp \
+ common/validate.cpp \
+ common/wxexpr.cpp \
\
gtk/app.cpp \
gtk/bitmap.cpp \
+ gtk/bmpbuttn.cpp \
gtk/brush.cpp \
gtk/button.cpp \
gtk/checkbox.cpp \
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxBitmapButton::wxBitmapButton(void)
{
-};
-
-wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, bitmap, pos, size, style, name );
-};
+}
bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, newSize, style, name );
+ SetValidator( validator );
+
m_bitmap = bitmap;
m_label = "";
gtk_widget_show( pixmap );
gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
- };
+ }
if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
Show( TRUE );
return TRUE;
-};
+}
void wxBitmapButton::SetDefault(void)
{
-};
+ gtk_widget_grab_default( m_widget );
+}
void wxBitmapButton::SetLabel( const wxString &label )
{
wxControl::SetLabel( label );
-};
+}
wxString wxBitmapButton::GetLabel(void) const
{
return wxControl::GetLabel();
-};
+}
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxButton::wxButton(void)
{
-};
-
-wxButton::wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, label, pos, size, style, name );
-};
+}
bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
wxSize newSize = size;
PreCreation( parent, id, pos, newSize, style, name );
+
+ SetValidator( validator );
m_widget = gtk_button_new_with_label( m_label );
SetLabel(label);
Show( TRUE );
return TRUE;
-};
+}
void wxButton::SetDefault(void)
{
-};
+ gtk_widget_grab_default( m_widget );
+}
void wxButton::SetLabel( const wxString &label )
{
GtkButton *bin = GTK_BUTTON( m_widget );
GtkLabel *g_label = GTK_LABEL( bin->child );
gtk_label_set( g_label, GetLabel() );
-};
+}
event.SetInt( cb->GetValue() );
event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxCheckBox::wxCheckBox(void)
{
-};
-
-wxCheckBox::wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, label, pos, size, style, name );
-};
+}
bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
SetLabel( label );
m_widget = gtk_check_button_new_with_label( label );
Show( TRUE );
return TRUE;
-};
+}
void wxCheckBox::SetValue( bool state )
{
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_ACTIVE );
else
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_NORMAL );
-};
+}
bool wxCheckBox::GetValue(void) const
{
GtkToggleButton *tb = GTK_TOGGLE_BUTTON(m_widget);
return tb->active;
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject(choice);
choice->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxChoice::wxChoice(void)
{
-};
-
-wxChoice::wxChoice( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- long style, const wxString &name )
-{
- Create( parent, id, pos, size, n, choices, style, name );
-};
+}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_option_menu_new();
wxSize newSize = size;
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_show( item );
- };
+ }
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxChoice::Append( const wxString &item )
{
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
gtk_menu_append( GTK_MENU(menu), menu_item );
gtk_widget_show( menu_item );
-};
+}
void wxChoice::Clear(void)
{
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
-};
+}
int wxChoice::FindString( const wxString &string ) const
{
if (string == label->label) return count;
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: string not found" );
return -1;
-};
+}
int wxChoice::GetColumns(void) const
{
return 1;
-};
+}
int wxChoice::GetSelection(void)
{
if (!bin->child) return count;
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: no selection" );
return -1;
-};
+}
wxString wxChoice::GetString( int n ) const
{
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
return label->label;
- };
+ }
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: string not found" );
return "";
-};
+}
wxString wxChoice::GetStringSelection(void) const
{
wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
return label->label;
-};
+}
int wxChoice::Number(void) const
{
{
count++;
child = child->next;
- };
+ }
return count;
-};
+}
void wxChoice::SetColumns( int WXUNUSED(n) )
{
-};
+}
void wxChoice::SetSelection( int n )
{
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
gtk_choice_clicked_callback( NULL, this );
-};
+}
void wxChoice::SetStringSelection( const wxString &string )
{
int n = FindString( string );
if (n != -1) SetSelection( n );
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject(combo);
combo->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
// size
alloc->width - widget->button->allocation.width;
return FALSE;
-};
+}
*/
//-----------------------------------------------------------------------------
bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_alreadySent = FALSE;
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_combo_new();
wxSize newSize = size;
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
- };
+ }
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxComboBox::Clear(void)
{
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
m_clientData.Clear();
-};
+}
void wxComboBox::Append( const wxString &item )
{
Append( item, (char*)NULL );
-};
+}
void wxComboBox::Append( const wxString &item, char *clientData )
{
gtk_widget_show( list_item );
m_clientData.Append( (wxObject*)clientData );
-};
+}
void wxComboBox::Delete( int n )
{
}
else
m_clientData.DeleteNode( node );
-};
+}
int wxComboBox::FindString( const wxString &item )
{
if (item == label->label) return count;
count++;
child = child->next;
- };
+ }
wxFAIL_MSG( "wxComboBox: string not found" );
return -1;
-};
+}
char* wxComboBox::GetClientData( int n )
{
wxFAIL_MSG( "wxComboBox: wrong index" );
return NULL;
-};
+}
void wxComboBox::SetClientData( int n, char * clientData )
{
if (node) node->SetData( (wxObject*) clientData );
wxFAIL_MSG( "wxComboBox: wrong index" );
-};
+}
int wxComboBox::GetSelection(void) const
{
if (child->data == selection->data) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
wxFAIL_MSG( "wxComboBox: no selection" );
return -1;
-};
+}
wxString wxComboBox::GetString( int n ) const
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
return label->label;
- };
+ }
wxFAIL_MSG( "wxComboBox: wrong index" );
return "";
-};
+}
wxString wxComboBox::GetStringSelection(void) const
{
GtkBin *bin = GTK_BIN( selection->data );
wxString tmp = GTK_LABEL( bin->child )->label;
return tmp;
- };
+ }
wxFAIL_MSG( "wxComboBox: no selection" );
return "";
-};
+}
int wxComboBox::Number(void) const
{
GList *child = GTK_LIST(list)->children;
int count = 0;
- while (child) { count++; child = child->next; };
+ while (child) { count++; child = child->next; }
return count;
-};
+}
void wxComboBox::SetSelection( int n )
{
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n );
-};
+}
void wxComboBox::SetStringSelection( const wxString &string )
{
int res = FindString( string );
if (res == -1) return;
SetSelection( res );
-};
+}
wxString wxComboBox::GetValue(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = gtk_entry_get_text( GTK_ENTRY(entry) );
return tmp;
-};
+}
void wxComboBox::SetValue( const wxString& value )
{
wxString tmp = "";
if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), tmp );
-};
+}
void wxComboBox::Copy(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::Cut(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::Paste(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::SetInsertionPoint( long pos )
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int tmp = (int) pos;
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
-};
+}
void wxComboBox::SetInsertionPointEnd(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
SetInsertionPoint( pos-1 );
-};
+}
long wxComboBox::GetInsertionPoint(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
return (long) GTK_EDITABLE(entry)->current_pos;
-};
+}
long wxComboBox::GetLastPosition(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
return (long) pos-1;
-};
+}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
if (value.IsNull()) return;
gint pos = (gint)to;
gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
-};
+}
void wxComboBox::Remove(long from, long to)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
-};
+}
void wxComboBox::SetSelection( long WXUNUSED(from), long WXUNUSED(to) )
{
-};
+}
void wxComboBox::SetEditable( bool WXUNUSED(editable) )
{
-};
+}
wxControl::wxControl(void)
{
m_needParent = TRUE;
-};
+}
wxControl::wxControl( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) :
wxWindow( parent, id, pos, size, style, name )
{
-};
+}
void wxControl::Command( wxCommandEvent &WXUNUSED(event) )
{
-};
+}
void wxControl::SetLabel( const wxString &label )
{
m_label << *pc;
}
-};
+}
wxString wxControl::GetLabel(void) const
{
return m_label;
-};
+}
bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_rangeMax = range;
m_gaugePos = 0;
m_useProgressBar = TRUE;
Show( TRUE );
return TRUE;
-};
+}
void wxGauge::SetRange( int r )
{
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
void wxGauge::SetValue( int pos )
{
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
int wxGauge::GetRange(void) const
{
return m_rangeMax;
-};
+}
int wxGauge::GetValue(void) const
{
return m_gaugePos;
-};
+}
listbox->GetEventHandler()->ProcessEvent( event );
if (event.m_commandString) delete[] event.m_commandString ;
-};
+}
//-----------------------------------------------------------------------------
wxListBox::wxListBox(void)
{
m_list = NULL;
-};
-
-wxListBox::wxListBox( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- long style, const wxString &name )
-{
- Create( parent, id, pos, size, n, choices, style, name );
-};
+}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_scrolled_window_new( NULL, NULL );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
m_clientData.Append( (wxObject*)NULL );
gtk_widget_show( list_item );
- };
+ }
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxListBox::Append( const wxString &item )
{
Append( item, (char*)NULL );
-};
+}
void wxListBox::Append( const wxString &item, char *clientData )
{
m_clientData.Append( (wxObject*)clientData );
gtk_widget_show( list_item );
-};
+}
void wxListBox::Clear(void)
{
gtk_list_clear_items( m_list, 0, Number() );
m_clientData.Clear();
-};
+}
void wxListBox::Delete( int n )
{
}
else
m_clientData.DeleteNode( node );
-};
+}
void wxListBox::Deselect( int n )
{
gtk_list_unselect_item( m_list, n );
-};
+}
int wxListBox::FindString( const wxString &item ) const
{
if (item == label->label) return count;
count++;
child = child->next;
- };
+ }
return -1;
-};
+}
char *wxListBox::GetClientData( int n ) const
{
wxNode *node = m_clientData.Nth( n );
if (node) return ((char*)node->Data());
return NULL;
-};
+}
int wxListBox::GetSelection(void) const
{
if (child->data == selection->data) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
return -1;
-};
+}
int wxListBox::GetSelections(wxArrayInt& aSelections) const
{
}
return count;
-};
+}
wxString wxListBox::GetString( int n ) const
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
return label->label;
- };
+ }
return "";
-};
+}
wxString wxListBox::GetStringSelection(void) const
{
GtkBin *bin = GTK_BIN( selection->data );
wxString tmp = GTK_LABEL( bin->child )->label;
return tmp;
- };
+ }
return "";
-};
+}
int wxListBox::Number(void)
{
GList *child = m_list->children;
int count = 0;
- while (child) { count++; child = child->next; };
+ while (child) { count++; child = child->next; }
return count;
-};
+}
bool wxListBox::Selected( int n )
{
{
if (child->data == target->data) return TRUE;
child = child->next;
- };
- };
+ }
+ }
return FALSE;
-};
+}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
-};
+}
void wxListBox::SetClientData( int n, char *clientData )
{
wxNode *node = m_clientData.Nth( n );
if (node) node->SetData( (wxObject*)clientData );
-};
+}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
-};
+}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
-};
+}
void wxListBox::SetSelection( int n, bool select )
{
gtk_list_select_item( m_list, n );
else
gtk_list_unselect_item( m_list, n );
-};
+}
void wxListBox::SetString( int n, const wxString &string )
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
gtk_label_set( label, string );
- };
-};
+ }
+}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
SetSelection( FindString(string), select );
-};
+}
int wxListBox::GetIndex( GtkWidget *item ) const
{
if (GTK_WIDGET(child->data) == item) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
return -1;
-};
+}
GtkWidget *wxListBox::GetConnectWidget(void)
{
return GTK_WIDGET(m_list);
-};
+}
PostCreation();
Show( TRUE );
-};
+}
void wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM(root_menu), menu->m_menu );
gtk_menu_bar_append( GTK_MENU_BAR(m_menubar), root_menu );
-};
+}
static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
{
{
int res = menu->FindItem( itemString );
if (res != -1) return res;
- };
+ }
wxNode *node = menu->m_items.First();
while (node)
{
if (item->IsSubMenu())
return FindMenuItemRecursive(item->GetSubMenu(), menuString, itemString);
node = node->Next();
- };
+ }
return -1;
-};
+}
int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemString ) const
{
int res = FindMenuItemRecursive( menu, menuString, itemString);
if (res != -1) return res;
node = node->Next();
- };
+ }
return -1;
-};
+}
// Find a wxMenuItem using its id. Recurses down into sub-menus
static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
if ( item->IsSubMenu() )
result = FindMenuItemByIdRecursive( item->GetSubMenu(), id );
node = node->Next();
- };
+ }
return result;
-};
+}
wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
{
{
wxMenuItem* item = FindMenuItemById( id );
if (item) item->Check(check);
-};
+}
bool wxMenuBar::Checked( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->IsChecked();
return FALSE;
-};
+}
void wxMenuBar::Enable( int id, bool enable )
{
wxMenuItem* item = FindMenuItemById( id );
if (item) item->Enable(enable);
-};
+}
bool wxMenuBar::Enabled( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->IsEnabled();
return FALSE;
-};
+}
//-----------------------------------------------------------------------------
// wxMenu
//-----------------------------------------------------------------------------
-void gtk_menu_clicked_callback( GtkWidget *widget, gpointer data )
+static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
- wxMenu *menu = (wxMenu*)data;
int id = menu->FindMenuIdByMenuItem(widget);
wxASSERT( id != -1 ); // should find it!
- if (!menu->IsEnabled(id))
- return;
+ if (!menu->IsEnabled(id)) return;
wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, id );
event.SetEventObject( menu );
event.SetInt(id );
+
+ if (menu->m_callback)
+ {
+ (void) (*(menu->m_callback)) (*menu, event);
+ return;
+ }
+
+ if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event );
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
m_isEnabled = TRUE;
m_subMenu = NULL;
m_menuItem = NULL;
-};
+}
void wxMenuItem::SetText(const wxString& str)
{
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
-wxMenu::wxMenu( const wxString &title )
+wxMenu::wxMenu( const wxString& title, const wxFunction func )
{
m_title = title;
m_items.DeleteContents( TRUE );
m_invokingWindow = NULL;
m_menu = gtk_menu_new(); // Do not show!
-};
+ m_callback = func;
+ m_eventHandler = this;
+ if (m_title.IsNull()) m_title = "";
+ if (m_title != "")
+ {
+ Append(-2, m_title);
+ AppendSeparator();
+ }
+}
void wxMenu::AppendSeparator()
{
gtk_widget_show( menuItem );
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
-};
+}
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
m_items.Append( mitem );
-};
+}
void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxString &helpStr )
{
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
m_items.Append( mitem );
-};
+}
int wxMenu::FindItem( const wxString itemString ) const
{
if (item->GetText() == s)
return item->GetId();
node = node->Next();
- };
+ }
return -1;
-};
+}
void wxMenu::Enable( int id, bool enable )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->Enable(enable);
-};
+}
bool wxMenu::IsEnabled( int id ) const
{
return item->IsEnabled();
else
return FALSE;
-};
+}
void wxMenu::Check( int id, bool enable )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->Check(enable);
-};
+}
bool wxMenu::IsChecked( int id ) const
{
return item->IsChecked();
else
return FALSE;
-};
+}
void wxMenu::SetLabel( int id, const wxString &label )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->SetText(label);
-};
+}
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{
if (item->GetMenuItem() == menuItem)
return item->GetId();
node = node->Next();
- };
+ }
return -1;
-};
+}
wxMenuItem *wxMenu::FindItem(int id) const
{
if ( item->GetId() == id )
return item;
node = node->Next();
- };
+ }
wxLogDebug(_("wxMenu::FindItem: item %d not found."), id);
void wxMenu::SetInvokingWindow( wxWindow *win )
{
m_invokingWindow = win;
-};
+}
wxWindow *wxMenu::GetInvokingWindow()
{
return m_invokingWindow;
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxRadioBox::wxRadioBox(void)
{
-};
-
-wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- int majorDim, long style,
- const wxString &name )
-{
- Create( parent, id, title, pos, size, n, choices, majorDim, style, name );
-};
+}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- int WXUNUSED(majorDim), long style,
- const wxString &name )
+ int n, const wxString choices[], int WXUNUSED(majorDim),
+ long style, const wxValidator& validator, const wxString &name )
{
m_alreadySent = FALSE;
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_frame_new( title );
int x = m_x+5;
y += 20;
height += 20;
- };
- };
+ }
+ }
wxSize newSize = size;
if (newSize.x == -1) newSize.x = maxLen+10;
Show( TRUE );
return TRUE;
-};
+}
bool wxRadioBox::Show( bool show )
{
GtkWidget *w = GTK_WIDGET( item->data );
if (show) gtk_widget_show( w ); else gtk_widget_hide( w );
item = item->next;
- };
+ }
return TRUE;
-};
+}
int wxRadioBox::FindString( const wxString &s ) const
{
if (s == l->label) return count;
count--;
item = item->next;
- };
+ }
return -1;
-};
+}
void wxRadioBox::SetSelection( int n )
{
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
gtk_toggle_button_set_state( button, 1 );
-};
+}
int wxRadioBox::GetSelection(void) const
{
if (GTK_TOGGLE_BUTTON(button)->active) return count;
count++;
item = item->next;
- };
+ }
return -1;
-};
+}
wxString wxRadioBox::GetString( int n ) const
{
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
return wxString( label->label );
-};
+}
wxString wxRadioBox::GetLabel(void) const
{
return wxControl::GetLabel();
-};
+}
void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
{
wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
return "";
-};
+}
void wxRadioBox::Enable( bool WXUNUSED(enable) )
{
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
{
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
{
wxFAIL_MSG("wxRadioBox::Show not implemented.");
-};
+}
wxString wxRadioBox::GetStringSelection(void) const
{
{
GtkLabel *label = GTK_LABEL( button->child );
return label->label;
- };
+ }
item = item->next;
- };
+ }
return "";
-};
+}
bool wxRadioBox::SetStringSelection( const wxString&s )
{
if (res == -1) return FALSE;
SetSelection( res );
return TRUE;
-};
+}
int wxRadioBox::Number(void) const
{
{
item = item->next;
count++;
- };
+ }
return count;
-};
+}
int wxRadioBox::GetNumberOfRowsOrCols(void) const
{
return 1;
-};
+}
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
-};
+}
#include "wx/radiobut.h"
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern bool g_blockEventsOnDrag;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
+
+static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRadioButton *rb )
+{
+ if (!rb->HasVMT()) return;
+ if (g_blockEventsOnDrag) return;
+
+ wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
+ event.SetInt( rb->GetValue() );
+ event.SetEventObject( rb );
+ rb->GetEventHandler()->ProcessEvent( event );
+}
+
+bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos, const wxSize& size, long style,
+ const wxValidator& validator, const wxString& name )
+{
+ m_needParent = TRUE;
+
+ wxSize newSize = size;
+
+ PreCreation( parent, id, pos, newSize, style, name );
+
+ SetValidator( validator );
+
+ m_widget = gtk_radio_button_new_with_label( NULL, label );
+
+ SetLabel(label);
+
+ if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+ if (newSize.y == -1) newSize.y = 26;
+ SetSize( newSize.x, newSize.y );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+ GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+
+ PostCreation();
+
+ Show( TRUE );
+
+ return TRUE;
+}
+
+void wxRadioButton::SetLabel( const wxString& label )
+{
+ wxControl::SetLabel( label );
+ GtkButton *bin = GTK_BUTTON( m_widget );
+ GtkLabel *g_label = GTK_LABEL( bin->child );
+ gtk_label_set( g_label, GetLabel() );
+}
+
+void wxRadioButton::SetValue( bool val )
+{
+ gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
+}
+
+bool wxRadioButton::GetValue(void) const
+{
+ return GTK_TOGGLE_BUTTON(m_widget)->active;
+}
+
+
cevent.SetEventObject( win );
win->ProcessEvent( cevent );
*/
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar,wxControl)
-wxScrollBar::wxScrollBar(wxWindow *parent, wxWindowID id,
- const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
-{
- Create( parent, id, pos, size, style, name );
-};
-
wxScrollBar::~wxScrollBar(void)
{
-};
+}
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_oldPos = 0.0;
if (style & wxSB_VERTICAL == wxSB_VERTICAL)
Show( TRUE );
return TRUE;
-};
+}
int wxScrollBar::GetPosition(void) const
{
return (int)(m_adjust->value+0.5);
-};
+}
int wxScrollBar::GetThumbSize() const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
int wxScrollBar::GetPageSize() const
{
return (int)(m_adjust->page_increment+0.5);
-};
+}
int wxScrollBar::GetRange() const
{
return (int)(m_adjust->upper+0.5);
-};
+}
void wxScrollBar::SetPosition( int viewStart )
{
m_adjust->value = fpos;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize,
bool WXUNUSED(refresh) )
m_adjust->page_size = fthumb;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
// Backward compatibility
int wxScrollBar::GetValue(void) const
{
return GetPosition();
-};
+}
void wxScrollBar::SetValue( int viewStart )
{
SetPosition( viewStart );
-};
+}
void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
{
*viewLength = range;
*objectLength = thumb;
*pageLength = page;
-};
+}
int wxScrollBar::GetViewLength() const
{
return (int)(m_adjust->upper+0.5);
-};
+}
int wxScrollBar::GetObjectLength() const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
void wxScrollBar::SetPageSize( int pageLength )
{
int thumb = (int)(m_adjust->page_size+0.5);
int range = (int)(m_adjust->upper+0.5);
SetScrollbar( pos, thumb, range, pageLength );
-};
+}
void wxScrollBar::SetObjectLength( int objectLength )
{
int page = (int)(m_adjust->page_increment+0.5);
int range = (int)(m_adjust->upper+0.5);
SetScrollbar( pos, objectLength, range, page );
-};
+}
void wxScrollBar::SetViewLength( int viewLength )
{
int thumb = (int)(m_adjust->page_size+0.5);
int page = (int)(m_adjust->page_increment+0.5);
SetScrollbar( pos, thumb, viewLength, page );
-};
+}
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
cevent.SetEventObject( win );
win->ProcessEvent( cevent );
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
wxSlider::wxSlider(void)
{
-};
-
-wxSlider::wxSlider( wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos, const wxSize& size,
- long style,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name )
-{
- Create( parent, id, value, minValue, maxValue,
- pos, size, style, name );
-};
+}
wxSlider::~wxSlider(void)
{
-};
+}
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos, const wxSize& size,
- long style,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_oldPos = 0.0;
if (style & wxSL_VERTICAL == wxSL_VERTICAL)
Show( TRUE );
return TRUE;
-};
+}
int wxSlider::GetValue(void) const
{
return (int)(m_adjust->value+0.5);
-};
+}
void wxSlider::SetValue( int value )
{
m_adjust->value = fpos;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
void wxSlider::SetRange( int minValue, int maxValue )
{
m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetMin(void) const
{
return (int)(m_adjust->lower+0.5);
-};
+}
int wxSlider::GetMax(void) const
{
return (int)(m_adjust->upper+0.5);
-};
+}
void wxSlider::SetPageSize( int pageSize )
{
m_adjust->page_increment = fpage;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetPageSize(void) const
{
return (int)(m_adjust->page_increment+0.5);
-};
+}
void wxSlider::SetThumbLength( int len )
{
m_adjust->page_size = flen;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetThumbLength(void) const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
void wxSlider::SetLineSize( int WXUNUSED(lineSize) )
{
-};
+}
int wxSlider::GetLineSize(void) const
{
return 0;
-};
+}
// not supported in wxGTK (and GTK)
void wxSlider::GetSize( int *x, int *y ) const
{
wxWindow::GetSize( x, y );
-};
+}
void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxWindow::SetSize( x, y, width, height, sizeFlags );
-};
+}
void wxSlider::GetPosition( int *x, int *y ) const
{
wxWindow::GetPosition( x, y );
-};
+}
void wxSlider::SetTick( int WXUNUSED(tickPos) )
{
-};
+}
void wxSlider::SetTickFreq( int WXUNUSED(n), int WXUNUSED(pos) )
{
-};
+}
int wxSlider::GetTickFreq(void) const
{
return 0;
-};
+}
void wxSlider::ClearTicks(void)
{
-};
+}
void wxSlider::SetSelection( int WXUNUSED(minPos), int WXUNUSED(maxPos) )
{
-};
+}
int wxSlider::GetSelEnd(void) const
{
return 0;
-};
+}
int wxSlider::GetSelStart(void) const
{
return 0;
-};
+}
void wxSlider::ClearSel(void)
{
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
-void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
+static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
win->SetModified();
-};
+}
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
wxTextCtrl::wxTextCtrl(void) : streambuf()
{
- if( allocate() )
- setp(base(),ebuf());
+ if (allocate()) setp(base(),ebuf());
m_modified = FALSE;
-};
+}
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
- int style, const wxString &name ) : streambuf()
+ int style, const wxValidator& validator, const wxString &name ) : streambuf()
{
- if( allocate() )
- setp(base(),ebuf());
+ if (allocate()) setp(base(),ebuf());
m_modified = FALSE;
- Create( parent, id, value, pos, size, style, name );
-};
+ Create( parent, id, value, pos, size, style, validator, name );
+}
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
- int style, const wxString &name )
+ int style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
bool bMultiLine = (style & wxTE_MULTILINE) != 0;
if ( bMultiLine )
{
{
gint tmp = 0;
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
- };
+ }
if (style & wxTE_READONLY)
{
{
if ( bMultiLine )
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
- };
+ }
Show( TRUE );
return TRUE;
-};
+}
wxString wxTextCtrl::GetValue(void) const
{
else
{
tmp = gtk_entry_get_text( GTK_ENTRY(m_text) );
- };
+ }
return tmp;
-};
+}
void wxTextCtrl::SetValue( const wxString &value )
{
else
{
gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
- };
-};
+ }
+}
void wxTextCtrl::WriteText( const wxString &text )
{
else
{
gtk_entry_append_text( GTK_ENTRY(m_text), text );
- };
-};
+ }
+}
bool wxTextCtrl::LoadFile( const wxString &WXUNUSED(file) )
{
- wxFAIL_MSG(_("wxTextCtrl::LoadFile not implemented"));
+ wxFAIL_MSG( "wxTextCtrl::LoadFile not implemented" );
return FALSE;
-};
+}
bool wxTextCtrl::SaveFile( const wxString &WXUNUSED(file) )
{
- wxFAIL_MSG(_("wxTextCtrl::SaveFile not implemented"));
+ wxFAIL_MSG( "wxTextCtrl::SaveFile not implemented" );
return FALSE;
-};
+}
/*
wxString wxTextCtrl::GetLineText( long lineNo ) const
{
-};
+}
void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
{
-};
+}
long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
{
-};
+}
long wxTextCtrl::XYToPosition( long x, long y )
{
-};
+}
int wxTextCtrl::GetNumberOfLines(void)
{
-};
+}
*/
void wxTextCtrl::SetInsertionPoint( long pos )
gtk_text_set_point( GTK_TEXT(m_text), tmp );
else
gtk_entry_set_position( GTK_ENTRY(m_text), tmp );
-};
+}
void wxTextCtrl::SetInsertionPointEnd(void)
{
else
pos = GTK_ENTRY(m_text)->text_length;
SetInsertionPoint( pos-1 );
-};
+}
void wxTextCtrl::SetEditable( bool editable )
{
gtk_text_set_editable( GTK_TEXT(m_text), editable );
else
gtk_entry_set_editable( GTK_ENTRY(m_text), editable );
-};
+}
void wxTextCtrl::SetSelection( long from, long to )
{
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
{
wxFAIL_MSG(_("wxTextCtrl::ShowPosition not implemented"));
-};
+}
long wxTextCtrl::GetInsertionPoint(void) const
{
return (long) GTK_EDITABLE(m_text)->current_pos;
-};
+}
long wxTextCtrl::GetLastPosition(void) const
{
else
pos = GTK_ENTRY(m_text)->text_length;
return (long)pos-1;
-};
+}
void wxTextCtrl::Remove( long from, long to )
{
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
if (value.IsNull()) return;
gint pos = (gint)to;
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
-};
+}
void wxTextCtrl::Cut(void)
{
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Copy(void)
{
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Paste(void)
{
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Delete(void)
{
SetValue( "" );
-};
+}
void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
{
-};
+}
int wxTextCtrl::overflow( int WXUNUSED(c) )
{
setp(pbase(), epptr());
delete[] txt;
return EOF;
-};
+}
int wxTextCtrl::sync(void)
{
setp(pbase(), epptr());
delete[] txt;
return 0;
-};
+}
int wxTextCtrl::underflow(void)
{
return EOF;
-};
+}
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
{
GtkWidget* wxTextCtrl::GetConnectWidget(void)
{
return GTK_WIDGET(m_text);
-};
+}
if (height) *height = gdk_screen_height();
}
+void wxGetMousePosition( int* x, int* y )
+{
+ wxFAIL_MSG( "GetMousePosition not yet implemented" );
+ if (x) *x = 0;
+ if (y) *y = 0;
+};
+
+bool wxColourDisplay(void)
+{
+ wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+ return TRUE;
+}
+
+int wxDisplayDepth(void)
+{
+ wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+ return 8;
+}
+
//------------------------------------------------------------------------
// user and home routines
//------------------------------------------------------------------------
m_resizing = FALSE;
}
-wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- m_cursor = NULL;
- Create( parent, id, pos, size, style, name );
-}
-
bool wxWindow::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxString &name )
{
m_isShown = FALSE;
m_isEnabled = TRUE;
m_needParent = TRUE;
+ m_cursor = NULL;
+
PreCreation( parent, id, pos, size, style, name );
m_widget = gtk_scrolled_window_new( NULL, NULL );
m_windowSizer = NULL;
}
// If this is a child of a sizer, remove self from parent
- if (m_sizerParent)
- m_sizerParent->RemoveChild((wxWindow *)this);
+ if (m_sizerParent) m_sizerParent->RemoveChild((wxWindow *)this);
// Just in case the window has been Closed, but
// we're then deleting immediately: don't leave
// class
wxTopLevelWindows.DeleteObject(this);
+ if (m_windowValidator) delete m_windowValidator;
}
void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
if (m_height == -1) m_height = 20;
m_retCode = 0;
m_eventHandler = this;
- m_windowValidator = NULL;
m_windowId = id;
m_sizeSet = FALSE;
if (m_cursor == NULL)
m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
+ m_windowValidator = NULL;
}
void wxWindow::PostCreation(void)
return m_windowValidator;
}
-void wxWindow::SetValidator( wxValidator *validator )
+void wxWindow::SetValidator( const wxValidator& validator )
{
- m_windowValidator = validator;
+ if (m_windowValidator) delete m_windowValidator;
+ m_windowValidator = validator.Clone();
+ if (m_windowValidator) m_windowValidator->SetWindow(this);
}
bool wxWindow::IsBeingDeleted(void)
// do something ?
}
+wxColour wxWindow::GetForegroundColour(void) const
+{
+ return m_foregroundColour;
+}
+
+void wxWindow::SetForegroundColour( const wxColour &colour )
+{
+ m_foregroundColour = colour;
+}
+
bool wxWindow::Validate(void)
{
wxNode *node = GetChildren()->First();
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxBitmapButton::wxBitmapButton(void)
{
-};
-
-wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, bitmap, pos, size, style, name );
-};
+}
bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, newSize, style, name );
+ SetValidator( validator );
+
m_bitmap = bitmap;
m_label = "";
gtk_widget_show( pixmap );
gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
- };
+ }
if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
Show( TRUE );
return TRUE;
-};
+}
void wxBitmapButton::SetDefault(void)
{
-};
+ gtk_widget_grab_default( m_widget );
+}
void wxBitmapButton::SetLabel( const wxString &label )
{
wxControl::SetLabel( label );
-};
+}
wxString wxBitmapButton::GetLabel(void) const
{
return wxControl::GetLabel();
-};
+}
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxButton::wxButton(void)
{
-};
-
-wxButton::wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, label, pos, size, style, name );
-};
+}
bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
wxSize newSize = size;
PreCreation( parent, id, pos, newSize, style, name );
+
+ SetValidator( validator );
m_widget = gtk_button_new_with_label( m_label );
SetLabel(label);
Show( TRUE );
return TRUE;
-};
+}
void wxButton::SetDefault(void)
{
-};
+ gtk_widget_grab_default( m_widget );
+}
void wxButton::SetLabel( const wxString &label )
{
GtkButton *bin = GTK_BUTTON( m_widget );
GtkLabel *g_label = GTK_LABEL( bin->child );
gtk_label_set( g_label, GetLabel() );
-};
+}
event.SetInt( cb->GetValue() );
event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxCheckBox::wxCheckBox(void)
{
-};
-
-wxCheckBox::wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, label, pos, size, style, name );
-};
+}
bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
SetLabel( label );
m_widget = gtk_check_button_new_with_label( label );
Show( TRUE );
return TRUE;
-};
+}
void wxCheckBox::SetValue( bool state )
{
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_ACTIVE );
else
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_NORMAL );
-};
+}
bool wxCheckBox::GetValue(void) const
{
GtkToggleButton *tb = GTK_TOGGLE_BUTTON(m_widget);
return tb->active;
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject(choice);
choice->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxChoice::wxChoice(void)
{
-};
-
-wxChoice::wxChoice( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- long style, const wxString &name )
-{
- Create( parent, id, pos, size, n, choices, style, name );
-};
+}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_option_menu_new();
wxSize newSize = size;
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_show( item );
- };
+ }
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxChoice::Append( const wxString &item )
{
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
gtk_menu_append( GTK_MENU(menu), menu_item );
gtk_widget_show( menu_item );
-};
+}
void wxChoice::Clear(void)
{
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
-};
+}
int wxChoice::FindString( const wxString &string ) const
{
if (string == label->label) return count;
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: string not found" );
return -1;
-};
+}
int wxChoice::GetColumns(void) const
{
return 1;
-};
+}
int wxChoice::GetSelection(void)
{
if (!bin->child) return count;
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: no selection" );
return -1;
-};
+}
wxString wxChoice::GetString( int n ) const
{
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
return label->label;
- };
+ }
child = child->next;
count++;
- };
+ }
wxFAIL_MSG( "wxChoice: string not found" );
return "";
-};
+}
wxString wxChoice::GetStringSelection(void) const
{
wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
return label->label;
-};
+}
int wxChoice::Number(void) const
{
{
count++;
child = child->next;
- };
+ }
return count;
-};
+}
void wxChoice::SetColumns( int WXUNUSED(n) )
{
-};
+}
void wxChoice::SetSelection( int n )
{
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
gtk_choice_clicked_callback( NULL, this );
-};
+}
void wxChoice::SetStringSelection( const wxString &string )
{
int n = FindString( string );
if (n != -1) SetSelection( n );
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject(combo);
combo->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
// size
alloc->width - widget->button->allocation.width;
return FALSE;
-};
+}
*/
//-----------------------------------------------------------------------------
bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_alreadySent = FALSE;
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_combo_new();
wxSize newSize = size;
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
- };
+ }
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxComboBox::Clear(void)
{
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
m_clientData.Clear();
-};
+}
void wxComboBox::Append( const wxString &item )
{
Append( item, (char*)NULL );
-};
+}
void wxComboBox::Append( const wxString &item, char *clientData )
{
gtk_widget_show( list_item );
m_clientData.Append( (wxObject*)clientData );
-};
+}
void wxComboBox::Delete( int n )
{
}
else
m_clientData.DeleteNode( node );
-};
+}
int wxComboBox::FindString( const wxString &item )
{
if (item == label->label) return count;
count++;
child = child->next;
- };
+ }
wxFAIL_MSG( "wxComboBox: string not found" );
return -1;
-};
+}
char* wxComboBox::GetClientData( int n )
{
wxFAIL_MSG( "wxComboBox: wrong index" );
return NULL;
-};
+}
void wxComboBox::SetClientData( int n, char * clientData )
{
if (node) node->SetData( (wxObject*) clientData );
wxFAIL_MSG( "wxComboBox: wrong index" );
-};
+}
int wxComboBox::GetSelection(void) const
{
if (child->data == selection->data) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
wxFAIL_MSG( "wxComboBox: no selection" );
return -1;
-};
+}
wxString wxComboBox::GetString( int n ) const
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
return label->label;
- };
+ }
wxFAIL_MSG( "wxComboBox: wrong index" );
return "";
-};
+}
wxString wxComboBox::GetStringSelection(void) const
{
GtkBin *bin = GTK_BIN( selection->data );
wxString tmp = GTK_LABEL( bin->child )->label;
return tmp;
- };
+ }
wxFAIL_MSG( "wxComboBox: no selection" );
return "";
-};
+}
int wxComboBox::Number(void) const
{
GList *child = GTK_LIST(list)->children;
int count = 0;
- while (child) { count++; child = child->next; };
+ while (child) { count++; child = child->next; }
return count;
-};
+}
void wxComboBox::SetSelection( int n )
{
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n );
-};
+}
void wxComboBox::SetStringSelection( const wxString &string )
{
int res = FindString( string );
if (res == -1) return;
SetSelection( res );
-};
+}
wxString wxComboBox::GetValue(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = gtk_entry_get_text( GTK_ENTRY(entry) );
return tmp;
-};
+}
void wxComboBox::SetValue( const wxString& value )
{
wxString tmp = "";
if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), tmp );
-};
+}
void wxComboBox::Copy(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::Cut(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::Paste(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
-};
+}
void wxComboBox::SetInsertionPoint( long pos )
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int tmp = (int) pos;
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
-};
+}
void wxComboBox::SetInsertionPointEnd(void)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
SetInsertionPoint( pos-1 );
-};
+}
long wxComboBox::GetInsertionPoint(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
return (long) GTK_EDITABLE(entry)->current_pos;
-};
+}
long wxComboBox::GetLastPosition(void) const
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
return (long) pos-1;
-};
+}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
if (value.IsNull()) return;
gint pos = (gint)to;
gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
-};
+}
void wxComboBox::Remove(long from, long to)
{
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
-};
+}
void wxComboBox::SetSelection( long WXUNUSED(from), long WXUNUSED(to) )
{
-};
+}
void wxComboBox::SetEditable( bool WXUNUSED(editable) )
{
-};
+}
wxControl::wxControl(void)
{
m_needParent = TRUE;
-};
+}
wxControl::wxControl( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) :
wxWindow( parent, id, pos, size, style, name )
{
-};
+}
void wxControl::Command( wxCommandEvent &WXUNUSED(event) )
{
-};
+}
void wxControl::SetLabel( const wxString &label )
{
m_label << *pc;
}
-};
+}
wxString wxControl::GetLabel(void) const
{
return m_label;
-};
+}
bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_rangeMax = range;
m_gaugePos = 0;
m_useProgressBar = TRUE;
Show( TRUE );
return TRUE;
-};
+}
void wxGauge::SetRange( int r )
{
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
void wxGauge::SetValue( int pos )
{
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
-};
+}
int wxGauge::GetRange(void) const
{
return m_rangeMax;
-};
+}
int wxGauge::GetValue(void) const
{
return m_gaugePos;
-};
+}
listbox->GetEventHandler()->ProcessEvent( event );
if (event.m_commandString) delete[] event.m_commandString ;
-};
+}
//-----------------------------------------------------------------------------
wxListBox::wxListBox(void)
{
m_list = NULL;
-};
-
-wxListBox::wxListBox( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- long style, const wxString &name )
-{
- Create( parent, id, pos, size, n, choices, style, name );
-};
+}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],
- long style, const wxString &name )
+ long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_scrolled_window_new( NULL, NULL );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
m_clientData.Append( (wxObject*)NULL );
gtk_widget_show( list_item );
- };
+ }
PostCreation();
Show( TRUE );
return TRUE;
-};
+}
void wxListBox::Append( const wxString &item )
{
Append( item, (char*)NULL );
-};
+}
void wxListBox::Append( const wxString &item, char *clientData )
{
m_clientData.Append( (wxObject*)clientData );
gtk_widget_show( list_item );
-};
+}
void wxListBox::Clear(void)
{
gtk_list_clear_items( m_list, 0, Number() );
m_clientData.Clear();
-};
+}
void wxListBox::Delete( int n )
{
}
else
m_clientData.DeleteNode( node );
-};
+}
void wxListBox::Deselect( int n )
{
gtk_list_unselect_item( m_list, n );
-};
+}
int wxListBox::FindString( const wxString &item ) const
{
if (item == label->label) return count;
count++;
child = child->next;
- };
+ }
return -1;
-};
+}
char *wxListBox::GetClientData( int n ) const
{
wxNode *node = m_clientData.Nth( n );
if (node) return ((char*)node->Data());
return NULL;
-};
+}
int wxListBox::GetSelection(void) const
{
if (child->data == selection->data) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
return -1;
-};
+}
int wxListBox::GetSelections(wxArrayInt& aSelections) const
{
}
return count;
-};
+}
wxString wxListBox::GetString( int n ) const
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
return label->label;
- };
+ }
return "";
-};
+}
wxString wxListBox::GetStringSelection(void) const
{
GtkBin *bin = GTK_BIN( selection->data );
wxString tmp = GTK_LABEL( bin->child )->label;
return tmp;
- };
+ }
return "";
-};
+}
int wxListBox::Number(void)
{
GList *child = m_list->children;
int count = 0;
- while (child) { count++; child = child->next; };
+ while (child) { count++; child = child->next; }
return count;
-};
+}
bool wxListBox::Selected( int n )
{
{
if (child->data == target->data) return TRUE;
child = child->next;
- };
- };
+ }
+ }
return FALSE;
-};
+}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
-};
+}
void wxListBox::SetClientData( int n, char *clientData )
{
wxNode *node = m_clientData.Nth( n );
if (node) node->SetData( (wxObject*)clientData );
-};
+}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
-};
+}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
-};
+}
void wxListBox::SetSelection( int n, bool select )
{
gtk_list_select_item( m_list, n );
else
gtk_list_unselect_item( m_list, n );
-};
+}
void wxListBox::SetString( int n, const wxString &string )
{
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
gtk_label_set( label, string );
- };
-};
+ }
+}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
SetSelection( FindString(string), select );
-};
+}
int wxListBox::GetIndex( GtkWidget *item ) const
{
if (GTK_WIDGET(child->data) == item) return count;
count++;
child = child->next;
- };
- };
+ }
+ }
return -1;
-};
+}
GtkWidget *wxListBox::GetConnectWidget(void)
{
return GTK_WIDGET(m_list);
-};
+}
PostCreation();
Show( TRUE );
-};
+}
void wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM(root_menu), menu->m_menu );
gtk_menu_bar_append( GTK_MENU_BAR(m_menubar), root_menu );
-};
+}
static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
{
{
int res = menu->FindItem( itemString );
if (res != -1) return res;
- };
+ }
wxNode *node = menu->m_items.First();
while (node)
{
if (item->IsSubMenu())
return FindMenuItemRecursive(item->GetSubMenu(), menuString, itemString);
node = node->Next();
- };
+ }
return -1;
-};
+}
int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemString ) const
{
int res = FindMenuItemRecursive( menu, menuString, itemString);
if (res != -1) return res;
node = node->Next();
- };
+ }
return -1;
-};
+}
// Find a wxMenuItem using its id. Recurses down into sub-menus
static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
if ( item->IsSubMenu() )
result = FindMenuItemByIdRecursive( item->GetSubMenu(), id );
node = node->Next();
- };
+ }
return result;
-};
+}
wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
{
{
wxMenuItem* item = FindMenuItemById( id );
if (item) item->Check(check);
-};
+}
bool wxMenuBar::Checked( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->IsChecked();
return FALSE;
-};
+}
void wxMenuBar::Enable( int id, bool enable )
{
wxMenuItem* item = FindMenuItemById( id );
if (item) item->Enable(enable);
-};
+}
bool wxMenuBar::Enabled( int id ) const
{
wxMenuItem* item = FindMenuItemById( id );
if (item) return item->IsEnabled();
return FALSE;
-};
+}
//-----------------------------------------------------------------------------
// wxMenu
//-----------------------------------------------------------------------------
-void gtk_menu_clicked_callback( GtkWidget *widget, gpointer data )
+static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
- wxMenu *menu = (wxMenu*)data;
int id = menu->FindMenuIdByMenuItem(widget);
wxASSERT( id != -1 ); // should find it!
- if (!menu->IsEnabled(id))
- return;
+ if (!menu->IsEnabled(id)) return;
wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, id );
event.SetEventObject( menu );
event.SetInt(id );
+
+ if (menu->m_callback)
+ {
+ (void) (*(menu->m_callback)) (*menu, event);
+ return;
+ }
+
+ if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event );
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
m_isEnabled = TRUE;
m_subMenu = NULL;
m_menuItem = NULL;
-};
+}
void wxMenuItem::SetText(const wxString& str)
{
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
-wxMenu::wxMenu( const wxString &title )
+wxMenu::wxMenu( const wxString& title, const wxFunction func )
{
m_title = title;
m_items.DeleteContents( TRUE );
m_invokingWindow = NULL;
m_menu = gtk_menu_new(); // Do not show!
-};
+ m_callback = func;
+ m_eventHandler = this;
+ if (m_title.IsNull()) m_title = "";
+ if (m_title != "")
+ {
+ Append(-2, m_title);
+ AppendSeparator();
+ }
+}
void wxMenu::AppendSeparator()
{
gtk_widget_show( menuItem );
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
-};
+}
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
m_items.Append( mitem );
-};
+}
void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxString &helpStr )
{
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
m_items.Append( mitem );
-};
+}
int wxMenu::FindItem( const wxString itemString ) const
{
if (item->GetText() == s)
return item->GetId();
node = node->Next();
- };
+ }
return -1;
-};
+}
void wxMenu::Enable( int id, bool enable )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->Enable(enable);
-};
+}
bool wxMenu::IsEnabled( int id ) const
{
return item->IsEnabled();
else
return FALSE;
-};
+}
void wxMenu::Check( int id, bool enable )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->Check(enable);
-};
+}
bool wxMenu::IsChecked( int id ) const
{
return item->IsChecked();
else
return FALSE;
-};
+}
void wxMenu::SetLabel( int id, const wxString &label )
{
wxMenuItem *item = FindItem(id);
if ( item )
item->SetText(label);
-};
+}
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{
if (item->GetMenuItem() == menuItem)
return item->GetId();
node = node->Next();
- };
+ }
return -1;
-};
+}
wxMenuItem *wxMenu::FindItem(int id) const
{
if ( item->GetId() == id )
return item;
node = node->Next();
- };
+ }
wxLogDebug(_("wxMenu::FindItem: item %d not found."), id);
void wxMenu::SetInvokingWindow( wxWindow *win )
{
m_invokingWindow = win;
-};
+}
wxWindow *wxMenu::GetInvokingWindow()
{
return m_invokingWindow;
-};
+}
event.SetString( WXSTRINGCAST(tmp) );
event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent(event);
-};
+}
//-----------------------------------------------------------------------------
wxRadioBox::wxRadioBox(void)
{
-};
-
-wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- int majorDim, long style,
- const wxString &name )
-{
- Create( parent, id, title, pos, size, n, choices, majorDim, style, name );
-};
+}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- int WXUNUSED(majorDim), long style,
- const wxString &name )
+ int n, const wxString choices[], int WXUNUSED(majorDim),
+ long style, const wxValidator& validator, const wxString &name )
{
m_alreadySent = FALSE;
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_widget = gtk_frame_new( title );
int x = m_x+5;
y += 20;
height += 20;
- };
- };
+ }
+ }
wxSize newSize = size;
if (newSize.x == -1) newSize.x = maxLen+10;
Show( TRUE );
return TRUE;
-};
+}
bool wxRadioBox::Show( bool show )
{
GtkWidget *w = GTK_WIDGET( item->data );
if (show) gtk_widget_show( w ); else gtk_widget_hide( w );
item = item->next;
- };
+ }
return TRUE;
-};
+}
int wxRadioBox::FindString( const wxString &s ) const
{
if (s == l->label) return count;
count--;
item = item->next;
- };
+ }
return -1;
-};
+}
void wxRadioBox::SetSelection( int n )
{
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
gtk_toggle_button_set_state( button, 1 );
-};
+}
int wxRadioBox::GetSelection(void) const
{
if (GTK_TOGGLE_BUTTON(button)->active) return count;
count++;
item = item->next;
- };
+ }
return -1;
-};
+}
wxString wxRadioBox::GetString( int n ) const
{
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
return wxString( label->label );
-};
+}
wxString wxRadioBox::GetLabel(void) const
{
return wxControl::GetLabel();
-};
+}
void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
-};
+}
wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
{
wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
return "";
-};
+}
void wxRadioBox::Enable( bool WXUNUSED(enable) )
{
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
{
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
-};
+}
void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
{
wxFAIL_MSG("wxRadioBox::Show not implemented.");
-};
+}
wxString wxRadioBox::GetStringSelection(void) const
{
{
GtkLabel *label = GTK_LABEL( button->child );
return label->label;
- };
+ }
item = item->next;
- };
+ }
return "";
-};
+}
bool wxRadioBox::SetStringSelection( const wxString&s )
{
if (res == -1) return FALSE;
SetSelection( res );
return TRUE;
-};
+}
int wxRadioBox::Number(void) const
{
{
item = item->next;
count++;
- };
+ }
return count;
-};
+}
int wxRadioBox::GetNumberOfRowsOrCols(void) const
{
return 1;
-};
+}
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
-};
+}
#include "wx/radiobut.h"
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern bool g_blockEventsOnDrag;
+
+//-----------------------------------------------------------------------------
+// wxRadioButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
+
+static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRadioButton *rb )
+{
+ if (!rb->HasVMT()) return;
+ if (g_blockEventsOnDrag) return;
+
+ wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
+ event.SetInt( rb->GetValue() );
+ event.SetEventObject( rb );
+ rb->GetEventHandler()->ProcessEvent( event );
+}
+
+bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos, const wxSize& size, long style,
+ const wxValidator& validator, const wxString& name )
+{
+ m_needParent = TRUE;
+
+ wxSize newSize = size;
+
+ PreCreation( parent, id, pos, newSize, style, name );
+
+ SetValidator( validator );
+
+ m_widget = gtk_radio_button_new_with_label( NULL, label );
+
+ SetLabel(label);
+
+ if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label );
+ if (newSize.y == -1) newSize.y = 26;
+ SetSize( newSize.x, newSize.y );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+ GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+
+ PostCreation();
+
+ Show( TRUE );
+
+ return TRUE;
+}
+
+void wxRadioButton::SetLabel( const wxString& label )
+{
+ wxControl::SetLabel( label );
+ GtkButton *bin = GTK_BUTTON( m_widget );
+ GtkLabel *g_label = GTK_LABEL( bin->child );
+ gtk_label_set( g_label, GetLabel() );
+}
+
+void wxRadioButton::SetValue( bool val )
+{
+ gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
+}
+
+bool wxRadioButton::GetValue(void) const
+{
+ return GTK_TOGGLE_BUTTON(m_widget)->active;
+}
+
+
cevent.SetEventObject( win );
win->ProcessEvent( cevent );
*/
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar,wxControl)
-wxScrollBar::wxScrollBar(wxWindow *parent, wxWindowID id,
- const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
-{
- Create( parent, id, pos, size, style, name );
-};
-
wxScrollBar::~wxScrollBar(void)
{
-};
+}
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
- long style, const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_oldPos = 0.0;
if (style & wxSB_VERTICAL == wxSB_VERTICAL)
Show( TRUE );
return TRUE;
-};
+}
int wxScrollBar::GetPosition(void) const
{
return (int)(m_adjust->value+0.5);
-};
+}
int wxScrollBar::GetThumbSize() const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
int wxScrollBar::GetPageSize() const
{
return (int)(m_adjust->page_increment+0.5);
-};
+}
int wxScrollBar::GetRange() const
{
return (int)(m_adjust->upper+0.5);
-};
+}
void wxScrollBar::SetPosition( int viewStart )
{
m_adjust->value = fpos;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize,
bool WXUNUSED(refresh) )
m_adjust->page_size = fthumb;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
// Backward compatibility
int wxScrollBar::GetValue(void) const
{
return GetPosition();
-};
+}
void wxScrollBar::SetValue( int viewStart )
{
SetPosition( viewStart );
-};
+}
void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
{
*viewLength = range;
*objectLength = thumb;
*pageLength = page;
-};
+}
int wxScrollBar::GetViewLength() const
{
return (int)(m_adjust->upper+0.5);
-};
+}
int wxScrollBar::GetObjectLength() const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
void wxScrollBar::SetPageSize( int pageLength )
{
int thumb = (int)(m_adjust->page_size+0.5);
int range = (int)(m_adjust->upper+0.5);
SetScrollbar( pos, thumb, range, pageLength );
-};
+}
void wxScrollBar::SetObjectLength( int objectLength )
{
int page = (int)(m_adjust->page_increment+0.5);
int range = (int)(m_adjust->upper+0.5);
SetScrollbar( pos, objectLength, range, page );
-};
+}
void wxScrollBar::SetViewLength( int viewLength )
{
int thumb = (int)(m_adjust->page_size+0.5);
int page = (int)(m_adjust->page_increment+0.5);
SetScrollbar( pos, thumb, viewLength, page );
-};
+}
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
cevent.SetEventObject( win );
win->ProcessEvent( cevent );
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
wxSlider::wxSlider(void)
{
-};
-
-wxSlider::wxSlider( wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos, const wxSize& size,
- long style,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name )
-{
- Create( parent, id, value, minValue, maxValue,
- pos, size, style, name );
-};
+}
wxSlider::~wxSlider(void)
{
-};
+}
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos, const wxSize& size,
- long style,
-/* const wxValidator& validator = wxDefaultValidator, */
- const wxString& name )
+ long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
m_oldPos = 0.0;
if (style & wxSL_VERTICAL == wxSL_VERTICAL)
Show( TRUE );
return TRUE;
-};
+}
int wxSlider::GetValue(void) const
{
return (int)(m_adjust->value+0.5);
-};
+}
void wxSlider::SetValue( int value )
{
m_adjust->value = fpos;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
-};
+}
void wxSlider::SetRange( int minValue, int maxValue )
{
m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetMin(void) const
{
return (int)(m_adjust->lower+0.5);
-};
+}
int wxSlider::GetMax(void) const
{
return (int)(m_adjust->upper+0.5);
-};
+}
void wxSlider::SetPageSize( int pageSize )
{
m_adjust->page_increment = fpage;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetPageSize(void) const
{
return (int)(m_adjust->page_increment+0.5);
-};
+}
void wxSlider::SetThumbLength( int len )
{
m_adjust->page_size = flen;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-};
+}
int wxSlider::GetThumbLength(void) const
{
return (int)(m_adjust->page_size+0.5);
-};
+}
void wxSlider::SetLineSize( int WXUNUSED(lineSize) )
{
-};
+}
int wxSlider::GetLineSize(void) const
{
return 0;
-};
+}
// not supported in wxGTK (and GTK)
void wxSlider::GetSize( int *x, int *y ) const
{
wxWindow::GetSize( x, y );
-};
+}
void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxWindow::SetSize( x, y, width, height, sizeFlags );
-};
+}
void wxSlider::GetPosition( int *x, int *y ) const
{
wxWindow::GetPosition( x, y );
-};
+}
void wxSlider::SetTick( int WXUNUSED(tickPos) )
{
-};
+}
void wxSlider::SetTickFreq( int WXUNUSED(n), int WXUNUSED(pos) )
{
-};
+}
int wxSlider::GetTickFreq(void) const
{
return 0;
-};
+}
void wxSlider::ClearTicks(void)
{
-};
+}
void wxSlider::SetSelection( int WXUNUSED(minPos), int WXUNUSED(maxPos) )
{
-};
+}
int wxSlider::GetSelEnd(void) const
{
return 0;
-};
+}
int wxSlider::GetSelStart(void) const
{
return 0;
-};
+}
void wxSlider::ClearSel(void)
{
-};
+}
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
-void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
+static void gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
win->SetModified();
-};
+}
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
wxTextCtrl::wxTextCtrl(void) : streambuf()
{
- if( allocate() )
- setp(base(),ebuf());
+ if (allocate()) setp(base(),ebuf());
m_modified = FALSE;
-};
+}
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
- int style, const wxString &name ) : streambuf()
+ int style, const wxValidator& validator, const wxString &name ) : streambuf()
{
- if( allocate() )
- setp(base(),ebuf());
+ if (allocate()) setp(base(),ebuf());
m_modified = FALSE;
- Create( parent, id, value, pos, size, style, name );
-};
+ Create( parent, id, value, pos, size, style, validator, name );
+}
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
- int style, const wxString &name )
+ int style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
PreCreation( parent, id, pos, size, style, name );
+ SetValidator( validator );
+
bool bMultiLine = (style & wxTE_MULTILINE) != 0;
if ( bMultiLine )
{
{
gint tmp = 0;
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
- };
+ }
if (style & wxTE_READONLY)
{
{
if ( bMultiLine )
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
- };
+ }
Show( TRUE );
return TRUE;
-};
+}
wxString wxTextCtrl::GetValue(void) const
{
else
{
tmp = gtk_entry_get_text( GTK_ENTRY(m_text) );
- };
+ }
return tmp;
-};
+}
void wxTextCtrl::SetValue( const wxString &value )
{
else
{
gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
- };
-};
+ }
+}
void wxTextCtrl::WriteText( const wxString &text )
{
else
{
gtk_entry_append_text( GTK_ENTRY(m_text), text );
- };
-};
+ }
+}
bool wxTextCtrl::LoadFile( const wxString &WXUNUSED(file) )
{
- wxFAIL_MSG(_("wxTextCtrl::LoadFile not implemented"));
+ wxFAIL_MSG( "wxTextCtrl::LoadFile not implemented" );
return FALSE;
-};
+}
bool wxTextCtrl::SaveFile( const wxString &WXUNUSED(file) )
{
- wxFAIL_MSG(_("wxTextCtrl::SaveFile not implemented"));
+ wxFAIL_MSG( "wxTextCtrl::SaveFile not implemented" );
return FALSE;
-};
+}
/*
wxString wxTextCtrl::GetLineText( long lineNo ) const
{
-};
+}
void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
{
-};
+}
long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
{
-};
+}
long wxTextCtrl::XYToPosition( long x, long y )
{
-};
+}
int wxTextCtrl::GetNumberOfLines(void)
{
-};
+}
*/
void wxTextCtrl::SetInsertionPoint( long pos )
gtk_text_set_point( GTK_TEXT(m_text), tmp );
else
gtk_entry_set_position( GTK_ENTRY(m_text), tmp );
-};
+}
void wxTextCtrl::SetInsertionPointEnd(void)
{
else
pos = GTK_ENTRY(m_text)->text_length;
SetInsertionPoint( pos-1 );
-};
+}
void wxTextCtrl::SetEditable( bool editable )
{
gtk_text_set_editable( GTK_TEXT(m_text), editable );
else
gtk_entry_set_editable( GTK_ENTRY(m_text), editable );
-};
+}
void wxTextCtrl::SetSelection( long from, long to )
{
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
{
wxFAIL_MSG(_("wxTextCtrl::ShowPosition not implemented"));
-};
+}
long wxTextCtrl::GetInsertionPoint(void) const
{
return (long) GTK_EDITABLE(m_text)->current_pos;
-};
+}
long wxTextCtrl::GetLastPosition(void) const
{
else
pos = GTK_ENTRY(m_text)->text_length;
return (long)pos-1;
-};
+}
void wxTextCtrl::Remove( long from, long to )
{
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
-};
+}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
if (value.IsNull()) return;
gint pos = (gint)to;
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
-};
+}
void wxTextCtrl::Cut(void)
{
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Copy(void)
{
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Paste(void)
{
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );
-};
+}
void wxTextCtrl::Delete(void)
{
SetValue( "" );
-};
+}
void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
{
-};
+}
int wxTextCtrl::overflow( int WXUNUSED(c) )
{
setp(pbase(), epptr());
delete[] txt;
return EOF;
-};
+}
int wxTextCtrl::sync(void)
{
setp(pbase(), epptr());
delete[] txt;
return 0;
-};
+}
int wxTextCtrl::underflow(void)
{
return EOF;
-};
+}
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
{
GtkWidget* wxTextCtrl::GetConnectWidget(void)
{
return GTK_WIDGET(m_text);
-};
+}
if (height) *height = gdk_screen_height();
}
+void wxGetMousePosition( int* x, int* y )
+{
+ wxFAIL_MSG( "GetMousePosition not yet implemented" );
+ if (x) *x = 0;
+ if (y) *y = 0;
+};
+
+bool wxColourDisplay(void)
+{
+ wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+ return TRUE;
+}
+
+int wxDisplayDepth(void)
+{
+ wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+ return 8;
+}
+
//------------------------------------------------------------------------
// user and home routines
//------------------------------------------------------------------------
m_resizing = FALSE;
}
-wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- m_cursor = NULL;
- Create( parent, id, pos, size, style, name );
-}
-
bool wxWindow::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxString &name )
{
m_isShown = FALSE;
m_isEnabled = TRUE;
m_needParent = TRUE;
+ m_cursor = NULL;
+
PreCreation( parent, id, pos, size, style, name );
m_widget = gtk_scrolled_window_new( NULL, NULL );
m_windowSizer = NULL;
}
// If this is a child of a sizer, remove self from parent
- if (m_sizerParent)
- m_sizerParent->RemoveChild((wxWindow *)this);
+ if (m_sizerParent) m_sizerParent->RemoveChild((wxWindow *)this);
// Just in case the window has been Closed, but
// we're then deleting immediately: don't leave
// class
wxTopLevelWindows.DeleteObject(this);
+ if (m_windowValidator) delete m_windowValidator;
}
void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
if (m_height == -1) m_height = 20;
m_retCode = 0;
m_eventHandler = this;
- m_windowValidator = NULL;
m_windowId = id;
m_sizeSet = FALSE;
if (m_cursor == NULL)
m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
+ m_windowValidator = NULL;
}
void wxWindow::PostCreation(void)
return m_windowValidator;
}
-void wxWindow::SetValidator( wxValidator *validator )
+void wxWindow::SetValidator( const wxValidator& validator )
{
- m_windowValidator = validator;
+ if (m_windowValidator) delete m_windowValidator;
+ m_windowValidator = validator.Clone();
+ if (m_windowValidator) m_windowValidator->SetWindow(this);
}
bool wxWindow::IsBeingDeleted(void)
// do something ?
}
+wxColour wxWindow::GetForegroundColour(void) const
+{
+ return m_foregroundColour;
+}
+
+void wxWindow::SetForegroundColour( const wxColour &colour )
+{
+ m_foregroundColour = colour;
+}
+
bool wxWindow::Validate(void)
{
wxNode *node = GetChildren()->First();
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
-include ../src/gtk/setup/general/makedirs
+include ../install/unix/setup/general/makedirs
#include <wx/utils.h>
#include <wx/frame.h>
#include <wx/panel.h>
+#include <wx/menu.h>
#include <wx/serbase.h>
#include "serwnd.h"