const wxSize& size,
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name);
const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- int style = 0, const wxValidator* validator = wxDefaultValidator,
-# else
int style = 0, const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString &name = "wxListTextCtrlText" );
void OnChar( wxKeyEvent &event );
wxListCtrl( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- long style = wxLC_ICON, const wxValidator* validator = wxDefaultValidator,
-# else
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString &name = "listctrl" )
{
bool Create( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- long style = wxLC_ICON, const wxValidator* validator = wxDefaultValidator,
-# else
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString &name = "listctrl" );
void OnSize( wxSizeEvent &event );
const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- int style = 0, const wxValidator* validator = wxDefaultValidator,
-# else
int style = 0, const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString &name = wxTextCtrlNameStr );
void OnChar( wxKeyEvent &event );
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator *validator = wxDefaultValidator,
-# else
const wxValidator &validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxTreeCtrlNameStr)
{
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator *validator = wxDefaultValidator,
-# else
const wxValidator &validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxTreeCtrlNameStr);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxButtonNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxButtonNameStr);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxButtonNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxButtonNameStr);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxCheckBoxNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxCheckBoxNameStr);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxCheckBoxNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxCheckBoxNameStr);
const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxListBoxNameStr);
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxChoiceNameStr)
{
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxChoiceNameStr);
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxComboBoxNameStr)
{
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxComboBoxNameStr);
#ifndef _WX_FRAME_H_
#define _WX_FRAME_H_
-#include "wx/window.h"
-#include "wx/os2/accel.h"
-#include "wx/icon.h"
-
-WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
-WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
-WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
-
-class WXDLLEXPORT wxMenuBar;
-class WXDLLEXPORT wxStatusBar;
-class WXDLLEXPORT wxToolBar;
-
-class WXDLLEXPORT wxFrame : public wxWindow
+class WXDLLEXPORT wxFrame : public wxFrameBase
{
- DECLARE_DYNAMIC_CLASS(wxFrame)
-
public:
- wxFrame();
+ // construction
+ wxFrame() { Init(); }
wxFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr)
{
+ Init();
+
Create(parent, id, title, pos, size, style, name);
}
- ~wxFrame();
-
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
- virtual bool Destroy();
-
- void OnSize(wxSizeEvent& event);
- void OnMenuHighlight(wxMenuEvent& event);
- void OnActivate(wxActivateEvent& event);
- void OnIdle(wxIdleEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
-
- bool Show(bool show);
-
- void DetachMenuBar();
- // Set menu bar
- void SetMenuBar(wxMenuBar *menu_bar);
- virtual wxMenuBar *GetMenuBar() const;
+ virtual ~wxFrame();
- // Call this to simulate a menu command
- bool Command(int id) { return ProcessCommand(id); }
+ // implement base class pure virtuals
+ virtual void Maximize(bool maximize = TRUE);
+ virtual bool IsMaximized() const;
+ virtual void Iconize(bool iconize = TRUE);
+ virtual bool IsIconized() const;
+ virtual void Restore();
+ virtual void SetMenuBar(wxMenuBar *menubar);
+ virtual void SetIcon(const wxIcon& icon);
- // process menu command: returns TRUE if processed
- bool ProcessCommand(int id);
+ // implementation only from now on
+ // -------------------------------
- // make the window modal (all other windows unresponsive)
- virtual void MakeModal(bool modal = TRUE);
+ // override some more virtuals
+ virtual bool Show(bool show = TRUE);
- // Set icon
- virtual void SetIcon(const wxIcon& icon);
+ // event handlers
+ void OnActivate(wxActivateEvent& event);
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
// Toolbar
#if wxUSE_TOOLBAR
wxWindowID id = -1,
const wxString& name = wxToolBarNameStr);
- virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
-
- virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
- virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
-
virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
-#if wxUSE_STATUSBAR
// Status bar
- virtual wxStatusBar* CreateStatusBar(int number = 1,
- long style = wxST_SIZEGRIP,
- wxWindowID id = 0,
- const wxString& name = wxStatusLineNameStr);
-
- wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
- void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
+#if wxUSE_STATUSBAR
+ virtual wxStatusBar* OnCreateStatusBar(int number = 1,
+ long style = wxST_SIZEGRIP,
+ wxWindowID id = 0,
+ const wxString& name = wxStatusLineNameStr);
virtual void PositionStatusBar();
- virtual wxStatusBar *OnCreateStatusBar(int number,
- long style,
- wxWindowID id,
- const wxString& name);
-
- // Set status line text
- virtual void SetStatusText(const wxString& text, int number = 0);
- // Set status line widths
- virtual void SetStatusWidths(int n, const int widths_field[]);
+ // Hint to tell framework which status bar to use: the default is to use
+ // native one for the platforms which support it (Win32), the generic one
+ // otherwise
- // Hint to tell framework which status bar to use
// TODO: should this go into a wxFrameworkSettings class perhaps?
- static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
- static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
+ static void UseNativeStatusBar(bool useNative)
+ { m_useNativeStatusBar = useNative; };
+ static bool UsesNativeStatusBar()
+ { return m_useNativeStatusBar; };
#endif // wxUSE_STATUSBAR
- // Iconize
- virtual void Iconize(bool iconize);
-
- virtual bool IsIconized() const;
-
- // Is it maximized?
- virtual bool IsMaximized() const;
-
- // Compatibility
- bool Iconized() const { return IsIconized(); }
-
- virtual void Maximize(bool maximize);
- // virtual bool LoadAccelerators(const wxString& table);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- // Query app for menu item updates (called from OnIdle)
- void DoMenuUpdates();
- void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
-
WXHMENU GetWinMenu() const { return m_hMenu; }
// Returns the origin of client area (may be different from (0,0) if the
// frame has a toolbar)
virtual wxPoint GetClientAreaOrigin() const;
- // Implementation only from here
- // event handlers
+ // event handlers
bool HandlePaint();
bool HandleSize(int x, int y, WXUINT flag);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
wxWindow *wx_win, const wxChar *title,
int x, int y, int width, int height, long style);
- // tooltip management
+ // tooltip management
#if wxUSE_TOOLTIPS
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
#endif // tooltips
protected:
+ // common part of all ctors
+ void Init();
+
+ // common part of Iconize(), Maximize() and Restore()
+ void DoShowWindow(int nShowCmd);
+
// override base class virtuals
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoClientToScreen(int *x, int *y) const;
virtual void DoScreenToClient(int *x, int *y) const;
+ // helper
+ void DetachMenuBar();
+
// a plug in for MDI frame classes which need to do something special when
// the menubar is set
virtual void InternalSetMenuBar();
// window proc for the frames
MRESULT OS2WindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- wxMenuBar * m_frameMenuBar;
- wxIcon m_icon;
bool m_iconized;
WXHICON m_defaultIcon;
#if wxUSE_STATUSBAR
- wxStatusBar * m_frameStatusBar;
-
static bool m_useNativeStatusBar;
#endif // wxUSE_STATUSBAR
-#if wxUSE_TOOLBAR
- wxToolBar* m_frameToolBar;
-#endif // wxUSE_TOOLBAR
-
private:
#if wxUSE_TOOLTIPS
WXHWND m_hwndToolTip;
#endif // tooltips
DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(wxFrame)
};
#endif
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxGaugeNameStr)
{
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxGaugeNameStr);
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxListBoxNameStr)
{
int n = 0, const wxString choices[] = NULL,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxListBoxNameStr);
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
-# else
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
-# endif
#endif
{
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
-# else
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
-# endif
#endif
virtual bool OS2Command(WXUINT param, WXWORD id);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxRadioButtonNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxRadioButtonNameStr);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxBitmapRadioButtonNameStr)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxBitmapRadioButtonNameStr);
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxScrollBarNameStr)
{
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxScrollBarNameStr);
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxSliderNameStr)
{
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxSliderNameStr);
const wxSize& size = wxDefaultSize,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxTextCtrlNameStr)
{
const wxSize& size = wxDefaultSize,
long style = 0,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif
const wxString& name = wxTextCtrlNameStr);
DECLARE_DYNAMIC_CLASS(wxValidator)
};
-#if defined(__VISAGECPP__)
-WXDLLEXPORT_DATA(extern const wxValidator*) wxDefaultValidator;
-#else
WXDLLEXPORT_DATA(extern const wxValidator) wxDefaultValidator;
-#endif
#endif // wxUSE_VALIDATORS
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
+
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator = wxDefaultValidator,
-# else
const wxValidator& validator = wxDefaultValidator,
-# endif
#endif // wxUSE_VALIDATORS
const wxString& name = wxPanelNameStr);
#if wxUSE_VALIDATORS
// a window may have an associated validator which is used to control
// user input
-# if defined(__VISAGECPP__)
- virtual void SetValidator( const wxValidator *validator );
-# else
virtual void SetValidator( const wxValidator &validator );
-# endif
virtual wxValidator *GetValidator() { return m_windowValidator; }
#endif // wxUSE_VALIDATORS
const wxSize& size,
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
#include "wx/validate.h"
-#if defined(__VISAGECPP__)
-// treated as a static global class by VA and thus cannot use in this form.
-// Defined as a pointer and then explicity allocated and deallocated
-// by user if desired
-const wxValidator* wxDefaultValidator = NULL;
-#else
const wxValidator wxDefaultValidator;
-#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxValidator, wxEvtHandler)
const wxSize& WXUNUSED(size),
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
// validators
// ----------------------------------------------------------------------------
-# if defined(__VISAGECPP__)
-void wxWindowBase::SetValidator(const wxValidator* validator)
-{
- if ( m_windowValidator )
- delete m_windowValidator;
-
- m_windowValidator = (wxValidator *)validator->Clone();
-
- if ( m_windowValidator )
- m_windowValidator->SetWindow(this) ;
-}
-# else
void wxWindowBase::SetValidator(const wxValidator& validator)
{
if ( m_windowValidator )
if ( m_windowValidator )
m_windowValidator->SetWindow(this) ;
}
-# endif // __VISAGECPP__
#endif // wxUSE_VALIDATORS
// ----------------------------------------------------------------------------
bool *accept, wxString *res, wxListMainWindow *owner,
const wxString &value, const wxPoint &pos, const wxSize &size,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- int style, const wxValidator* validator, const wxString &name ) :
-# else
int style, const wxValidator& validator, const wxString &name ) :
-# endif
#endif
wxTextCtrl( parent, id, value, pos, size, style, validator, name )
{
bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- long style, const wxValidator *validator,
-# else
long style, const wxValidator &validator,
-# endif
#endif
const wxString &name )
{
bool *accept, wxString *res, wxTreeCtrl *owner,
const wxString &value, const wxPoint &pos, const wxSize &size,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- int style, const wxValidator* validator, const wxString &name ) :
-# else
int style, const wxValidator& validator, const wxString &name ) :
-# endif
#endif
wxTextCtrl( parent, id, value, pos, size, style, validator, name )
{
m_dragCount = 0;
m_renameTimer = new wxTreeRenameTimer( this );
-
+
m_normalFont = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT );
m_boldFont = wxFont( m_normalFont.GetPointSize(),
m_normalFont.GetFamily(),
const wxPoint& pos, const wxSize& size,
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator *validator,
-# else
const wxValidator &validator,
-# endif
#endif
const wxString& name )
{
}
wxClientDC dc(this);
- wxGenericTreeItem *item =
+ wxGenericTreeItem *item =
new wxGenericTreeItem( parent, text, dc, image, selImage, data );
if ( data != NULL )
{
data->m_pItem = m_anchor;
}
-
+
if (!HasFlag(wxTR_MULTIPLE))
{
m_current = m_key_current = m_anchor;
dc.SetFont( m_normalFont );
dc.SetPen( m_dottedPen );
-
+
// this is now done dynamically
//if(GetImageList() == NULL)
// m_lineHeight = (int)(dc.GetCharHeight() + 4);
// showtime
if (m_NavigPan && m_Splitter) {
m_Splitter -> SetMinimumPaneSize(20);
+ if (m_Cfg.navig_on)
+ m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
+ else {
+ m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
+ m_Splitter -> Unsplit();
+ }
if (m_Cfg.navig_on) {
m_NavigPan -> Show(TRUE);
m_Splitter -> SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB
# Change WXDIR or WXWIN to wherever wxWindows is found
-WXDIR = j:\dev\wx2\wxWindows
+WXDIR = h:\dev\wx2\wxWindows
OS2JPEGDIR=$(WXDIR)\src\jpeg
OS2JPEGINC=$(WINJPEGDIR)
test2: ..\common\Debug\config.obj
$D:
- mkdir $D
+ md $D
$(COMMDIR)\$D:
- mkdir $(COMMDIR)\$D
+ md $(COMMDIR)\$D
$(MSWDIR)\$D:
- mkdir $(MSWDIR)\$D
+ md $(MSWDIR)\$D
$(GENDIR)\$D:
- mkdir $(GENDIR)\$D
+ md $(GENDIR)\$D
$(OLEDIR)\$D:
- mkdir $(OLEDIR)\$D
+ md $(OLEDIR)\$D
$(HTMLDIR)\$D:
- mkdir $(HTMLDIR)\$D
+ md $(HTMLDIR)\$D
# wxWindows library as DLL
dll:
$(DOCDIR)\html\wx\wx.htm: $(DOCDIR)\latex\wx\classes.tex $(DOCDIR)\latex\wx\body.tex $(DOCDIR)/latex/wx/topics.tex $(DOCDIR)\latex\wx\manual.tex
cd $(DOCDIR)\latex\wx
- -mkdir $(DOCDIR)\html\wx
+ -md $(DOCDIR)\html\wx
-start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\wx\manual.tex $(DOCDIR)\html\wx\wx.htm -twice -html
-erase $(DOCDIR)\html\wx\*.con
-erase $(DOCDIR)\html\wx\*.ref
$(DOCDIR)\html\porting\port.htm: $(DOCDIR)\latex\porting\porting.tex
cd $(DOCDIR)\latex\porting
- -mkdir $(DOCDIR)\html\porting
+ -md $(DOCDIR)\html\porting
-start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\porting\porting.tex $(DOCDIR)\html\porting\port.htm -twice -html
-erase $(DOCDIR)\html\porting\*.con
-erase $(DOCDIR)\html\porting\*.ref
$(DOCDIR)\html\proplist\prop.htm: $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\latex\proplist\body.tex $(DOCDIR)\latex\proplist\classes.tex $(DOCDIR)\latex\proplist\changes.tex
cd $(DOCDIR)\latex\proplist
- -mkdir $(DOCDIR)\html\proplist
+ -md $(DOCDIR)\html\proplist
-start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\html\proplist\prop.htm -twice -html
-erase $(DOCDIR)\html\proplist\*.con
-erase $(DOCDIR)\html\proplist\*.ref
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos, const wxSize& size,
int nStrings, const wxString choices[],
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- long style, const wxValidator* val,
-# else
long style, const wxValidator& val,
-# endif
#endif
const wxString& name)
: wxListBox()
int n, const wxString choices[],
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: colordlg.cpp
-// Purpose: wxColourDialog class. NOTE: you can use the generic class
-// if you wish, instead of implementing this.
-// Author: David Webster
-// Modified by:
-// Created: 10/13/99
-// RCS-ID: $Id$
-// Copyright: (c) David Webster
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/defs.h"
-#include "wx/bitmap.h"
-#include "wx/pen.h"
-#include "wx/brush.h"
-#include "wx/colour.h"
-#include "wx/gdicmn.h"
-#include "wx/utils.h"
-#include "wx/frame.h"
-#include "wx/dialog.h"
-#include "wx/msgdlg.h"
-#endif
-
-#define INCL_PM
-#include <os2.h>
-
-#include "wx/os2/private.h"
-#include "wx/colordlg.h"
-#include "wx/cmndata.h"
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define wxDIALOG_DEFAULT_X 300
-#define wxDIALOG_DEFAULT_Y 300
-
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
-#endif
-
-/*
- * wxColourDialog
- */
-
-wxColourDialog::wxColourDialog()
-{
- m_dialogParent = NULL;
-}
-
-wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
-{
- Create(parent, data);
-}
-
-bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
-{
- m_dialogParent = parent;
-
- if (data)
- m_colourData = *data;
- return TRUE;
-}
-
-int wxColourDialog::ShowModal()
-{
- /* TODO: implement dialog
- */
-
- return wxID_CANCEL;
-}
-
int n, const wxString choices[],
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#ifdef __BORLANDC__
- #pragma hdrstop
-#endif
-
#ifndef WX_PRECOMP
#include "wx/setup.h"
#include "wx/frame.h"
#endif // WX_PRECOMP
#include "wx/os2/private.h"
-#include "wx/statusbr.h"
-#include "wx/toolbar.h"
+
+#if wxUSE_STATUSBAR
+ #include "wx/statusbr.h"
+#endif // wxUSE_STATUSBAR
+
+#if wxUSE_TOOLBAR
+ #include "wx/toolbar.h"
+#endif // wxUSE_TOOLBAR
+
#include "wx/menuitem.h"
#include "wx/log.h"
+// ----------------------------------------------------------------------------
+// globals
+// ----------------------------------------------------------------------------
+
extern wxWindowList wxModelessWindows;
extern wxList WXDLLEXPORT wxPendingDelete;
extern wxChar wxFrameClassName[];
extern wxMenu *wxCurrentPopupMenu;
+// ----------------------------------------------------------------------------
+// event tables
+// ----------------------------------------------------------------------------
+
#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxFrame, wxWindow)
- EVT_SIZE(wxFrame::OnSize)
- EVT_ACTIVATE(wxFrame::OnActivate)
- EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
- EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
- EVT_IDLE(wxFrame::OnIdle)
- EVT_CLOSE(wxFrame::OnCloseWindow)
+BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
+ EVT_ACTIVATE(wxFrame::OnActivate)
+ EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
-bool wxFrame::m_useNativeStatusBar = FALSE;
+// ============================================================================
+// implementation
+// ============================================================================
-wxFrame::wxFrame()
-{
- m_frameToolBar = NULL ;
- m_frameMenuBar = NULL;
- m_frameStatusBar = NULL;
+// ----------------------------------------------------------------------------
+// static class members
+// ----------------------------------------------------------------------------
- m_iconized = FALSE;
-}
+#if wxUSE_NATIVE_STATUSBAR
+ bool wxFrame::m_useNativeStatusBar = TRUE;
+#else
+ bool wxFrame::m_useNativeStatusBar = FALSE;
+#endif
-bool wxFrame::Create(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxString& name)
+// ----------------------------------------------------------------------------
+// creation/destruction
+// ----------------------------------------------------------------------------
+
+void wxFrame::Init()
{
+ m_iconized = FALSE;
+
#if wxUSE_TOOLTIPS
m_hwndToolTip = 0;
#endif
+}
+bool wxFrame::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
+{
SetName(name);
m_windowStyle = style;
m_frameMenuBar = NULL;
- m_frameToolBar = NULL ;
+ m_frameToolBar = NULL;
m_frameStatusBar = NULL;
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
-// m_icon = NULL;
if ( id > -1 )
m_windowId = id;
else
m_isBeingDeleted = TRUE;
wxTopLevelWindows.DeleteObject(this);
- if (m_frameStatusBar)
- delete m_frameStatusBar;
- if (m_frameMenuBar)
- delete m_frameMenuBar;
-
-/* New behaviour March 1998: check if it's the last top-level window */
-// if (wxTheApp && (this == wxTheApp->GetTopWindow()))
+// TODO:
+/*
+ DeleteAllBars();
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
{
if (wxTheApp->GetExitOnFrameDelete())
{
-// PostQuitMessage(0);
+ PostQuitMessage(0);
}
}
// Try to bring the parent to the top.
// MT:Only do this if this frame is currently the active window, else weird
// things start to happen
-
-// TODO:
-/*
if ( wxGetActiveWindow() == this )
if (GetParent() && GetParent()->GetHWND())
::BringWindowToTop((HWND) GetParent()->GetHWND());
RECT rect;
::GetClientRect(GetHwnd(), &rect);
+#if wxUSE_STATUSBAR
if ( GetStatusBar() )
{
int statusX, statusY;
GetStatusBar()->GetClientSize(&statusX, &statusY);
rect.bottom -= statusY;
}
+#endif // wxUSE_STATUSBAR
wxPoint pt(GetClientAreaOrigin());
rect.bottom -= pt.y;
int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
+#if wxUSE_STATUSBAR
if ( GetStatusBar() )
{
int statusX, statusY;
GetStatusBar()->GetClientSize(&statusX, &statusY);
actual_height += statusY;
}
+#endif // wxUSE_STATUSBAR
wxPoint pt(GetClientAreaOrigin());
actual_width += pt.y;
*/
}
-bool wxFrame::Show(bool show)
+// ----------------------------------------------------------------------------
+// variations around ::ShowWindow()
+// ----------------------------------------------------------------------------
+
+void wxFrame::DoShowWindow(int nShowCmd)
{
// TODO:
/*
- int cshow;
- if (show)
- cshow = SW_SHOW;
- else
- cshow = SW_HIDE;
-
- if (!show)
- {
- // Try to highlight the correct window (the parent)
- HWND hWndParent = 0;
- if (GetParent())
- {
- hWndParent = (HWND) GetParent()->GetHWND();
- if (hWndParent)
- ::BringWindowToTop(hWndParent);
- }
- }
-
- ShowWindow(GetHwnd(), (BOOL)cshow);
- if (show)
- {
- BringWindowToTop(GetHwnd());
+ ::ShowWindow(GetHwnd(), nShowCmd);
- wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
- }
- return TRUE;
+ m_iconized = nShowCmd == SW_MINIMIZE;
*/
- return FALSE;
}
-void wxFrame::Iconize(bool iconize)
+bool wxFrame::Show(bool show)
{
// TODO:
/*
- if (!iconize)
- Show(TRUE);
+ DoShowWindow(show ? SW_SHOW : SW_HIDE);
- int cshow;
- if (iconize)
- cshow = SW_MINIMIZE;
- else
- cshow = SW_RESTORE;
- ShowWindow(GetHwnd(), (BOOL)cshow);
- m_iconized = iconize;
+ if ( show )
+ {
+ ::BringWindowToTop(GetHwnd());
+
+ wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId);
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent(event);
+ }
+ else
+ {
+ // Try to highlight the correct window (the parent)
+ if ( GetParent() )
+ {
+ HWND hWndParent = GetHwndOf(GetParent());
+ if (hWndParent)
+ ::BringWindowToTop(hWndParent);
+ }
+ }
*/
+ return TRUE;
+}
+
+void wxFrame::Iconize(bool iconize)
+{
+// DoShowWindow(iconize ? SW_MINIMIZE : SW_RESTORE);
}
-// Equivalent to maximize/restore in Windows
void wxFrame::Maximize(bool maximize)
{
-// TODO:
-/*
- Show(TRUE);
- int cshow;
- if (maximize)
- cshow = SW_MAXIMIZE;
- else
- cshow = SW_RESTORE;
- ShowWindow(GetHwnd(), cshow);
- m_iconized = FALSE;
-*/
+// DoShowWindow(maximize ? SW_MAXIMIZE : SW_RESTORE);
+}
+
+void wxFrame::Restore()
+{
+// DoShowWindow(SW_RESTORE);
}
bool wxFrame::IsIconized() const
((wxFrame *)this)->m_iconized = (::IsIconic(GetHwnd()) != 0);
return m_iconized;
*/
- return FALSE;
+ return FALSE;
}
// Is it maximized?
bool wxFrame::IsMaximized() const
{
-// return (::IsZoomed(GetHwnd()) != 0) ;
- return FALSE;
+// TODO:
+/*
+ return (::IsZoomed(GetHwnd()) != 0);
+*/
+ return FALSE;
}
void wxFrame::SetIcon(const wxIcon& icon)
{
+ wxFrameBase::SetIcon(icon);
+
// TODO:
/*
- m_icon = icon;
- if ( m_icon.Ok() )
- SendMessage(GetHwnd(), WM_SETICON,
- (WPARAM)TRUE, (LPARAM)(HICON) m_icon.GetHICON());
+ if ( m_icon.Ok() )
+ {
+ SendMessage(GetHwnd(), WM_SETICON,
+ (WPARAM)TRUE, (LPARAM)(HICON) m_icon.GetHICON());
+ }
*/
}
#if wxUSE_STATUSBAR
-wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
- const wxString& name)
+wxStatusBar *wxFrame::OnCreateStatusBar(int number,
+ long style,
+ wxWindowID id,
+ const wxString& name)
{
wxStatusBar *statusBar = NULL;
- {
- statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20),
- style, name);
-
- // Set the height according to the font and the border size
- wxClientDC dc(statusBar);
- dc.SetFont(statusBar->GetFont());
-
- long x, y;
- dc.GetTextExtent("X", &x, &y);
-
- int height = (int)( (y * 1.1) + 2* statusBar->GetBorderY());
-
- statusBar->SetSize(-1, -1, 100, height);
- }
-
- statusBar->SetFieldsCount(number);
- return statusBar;
-}
-
-wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id,
- const wxString& name)
-{
- // VZ: calling CreateStatusBar twice is an error - why anyone would do it?
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE,
- wxT("recreating status bar in wxFrame") );
-
- m_frameStatusBar = OnCreateStatusBar(number, style, id,
- name);
- if ( m_frameStatusBar )
- {
- PositionStatusBar();
- return m_frameStatusBar;
- }
- else
- return NULL;
-}
-
-void wxFrame::SetStatusText(const wxString& text, int number)
-{
- wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set text for") );
- m_frameStatusBar->SetStatusText(text, number);
-}
-
-void wxFrame::SetStatusWidths(int n, const int widths_field[])
-{
- wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set widths for") );
+ statusBar = wxFrameBase::OnCreateStatusBar(number, style, id, name);
- m_frameStatusBar->SetStatusWidths(n, widths_field);
- PositionStatusBar();
+ return statusBar;
}
void wxFrame::PositionStatusBar()
{
- // native status bar positions itself
- if (m_frameStatusBar)
- {
- int w, h;
- GetClientSize(&w, &h);
- int sw, sh;
- m_frameStatusBar->GetSize(&sw, &sh);
-
- // Since we wish the status bar to be directly under the client area,
- // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
- m_frameStatusBar->SetSize(0, h, w, sh);
- }
+// TODO:
+/*
+ // native status bar positions itself
+ if ( m_frameStatusBar )
+ {
+ int w, h;
+ GetClientSize(&w, &h);
+ int sw, sh;
+ m_frameStatusBar->GetSize(&sw, &sh);
+
+ // Since we wish the status bar to be directly under the client area,
+ // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
+ m_frameStatusBar->SetSize(0, h, w, sh);
+ }
+*/
}
#endif // wxUSE_STATUSBAR
// Responds to colour changes, and passes event on to children.
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{
+// TODO:
+/*
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh();
// Propagate the event to the non-top-level children
wxWindow::OnSysColourChanged(event);
+*/
}
/*
// style instead of WS_OVERLAPPED
if (width > -1 && height > -1)
::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(width, height));
-
- return TRUE;
*/
- return FALSE;
-}
-
-// Default resizing behaviour - if only ONE subwindow, resize to client
-// rectangle size
-void wxFrame::OnSize(wxSizeEvent& event)
-{
- // if we're using constraints - do use them
-#if wxUSE_CONSTRAINTS
- if ( GetAutoLayout() )
- {
- Layout();
- return;
- }
-#endif
-
- // do we have _exactly_ one child?
- wxWindow *child = NULL;
- for ( wxWindowList::Node *node = GetChildren().GetFirst();
- node;
- node = node->GetNext() )
- {
- wxWindow *win = node->GetData();
- if ( !win->IsTopLevel()
-#if wxUSE_STATUSBAR
- && (win != GetStatusBar())
-#endif // wxUSE_STATUSBAR
-#if wxUSE_TOOLBAR
- && (win != GetToolBar())
-#endif // wxUSE_TOOLBAR
- )
- {
- if ( child )
- return; // it's our second subwindow - nothing to do
- child = win;
- }
- }
-
- if ( child ) {
- // we have exactly one child - set it's size to fill the whole frame
- int clientW, clientH;
- GetClientSize(&clientW, &clientH);
-
- int x = 0;
- int y = 0;
-
- child->SetSize(x, y, clientW, clientH);
- }
+ return TRUE;
}
// Default activation behaviour - set the focus for the first child
}
}
-// The default implementation for the close window event.
-void wxFrame::OnCloseWindow(wxCloseEvent& event)
-{
- Destroy();
-}
-
-// Destroy the window (delayed, if a managed window)
-bool wxFrame::Destroy()
-{
- if (!wxPendingDelete.Member(this))
- wxPendingDelete.Append(this);
- return TRUE;
-}
-
-// Default menu selection behaviour - display a help string
-void wxFrame::OnMenuHighlight(wxMenuEvent& event)
-{
- if (GetStatusBar())
- {
- wxString help;
- int menuId = event.GetMenuId();
- if ( menuId != -1 )
- {
- wxMenuBar *menuBar = GetMenuBar();
- if (menuBar && menuBar->FindItem(menuId))
- {
- help = menuBar->GetHelpString(menuId);
- }
- }
-
- // set status text even if the string is empty - this will at
- // least remove the string from the item which was previously
- // selected
- SetStatusText(help);
- }
-}
-
-wxMenuBar *wxFrame::GetMenuBar() const
-{
- return m_frameMenuBar;
-}
-
-bool wxFrame::ProcessCommand(int id)
-{
- wxMenuBar *bar = GetMenuBar() ;
- if ( !bar )
- return FALSE;
-
- wxMenuItem *item = bar->FindItem(id);
-
- if ( item && item->IsCheckable() )
- {
- bar->Check(id, !bar->IsChecked(id)) ;
- }
-
- wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
- commandEvent.SetInt( id );
- commandEvent.SetEventObject( this );
-
- return GetEventHandler()->ProcessEvent(commandEvent);
-}
+// ----------------------------------------------------------------------------
+// wxFrame size management: we exclude the areas taken by menu/status/toolbars
+// from the client area, so the client area is what's really available for the
+// frame contents
+// ----------------------------------------------------------------------------
// Checks if there is a toolbar, and returns the first free client position
wxPoint wxFrame::GetClientAreaOrigin() const
wxWindow::DoClientToScreen(x, y);
}
+// ----------------------------------------------------------------------------
+// tool/status bar stuff
+// ----------------------------------------------------------------------------
+
#if wxUSE_TOOLBAR
+
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
- wxT("recreating toolbar in wxFrame") );
-
- wxToolBar* toolBar = OnCreateToolBar(style, id, name);
- if (toolBar)
+ if ( wxFrameBase::CreateToolBar(style, id, name) )
{
- SetToolBar(toolBar);
PositionToolBar();
- return toolBar;
- }
- else
- {
- return NULL;
}
-}
-wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name)
-{
- return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name);
+ return m_frameToolBar;
}
void wxFrame::PositionToolBar()
RECT rect;
::GetClientRect(GetHwnd(), &rect);
+#if wxUSE_STATUSBAR
if ( GetStatusBar() )
{
- int statusX, statusY;
- GetStatusBar()->GetClientSize(&statusX, &statusY);
- rect.bottom -= statusY;
+ int statusX, statusY;
+ GetStatusBar()->GetClientSize(&statusX, &statusY);
+ rect.bottom -= statusY;
}
+#endif // wxUSE_STATUSBAR
- if (GetToolBar())
+ if ( GetToolBar() )
{
int tw, th;
- GetToolBar()->GetSize(& tw, & th);
+ GetToolBar()->GetSize(&tw, &th);
- if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
+ if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
{
- // Use the 'real' MSW position
- GetToolBar()->SetSize(0, 0, tw, rect.bottom, wxSIZE_NO_ADJUSTMENTS);
+ th = rect.bottom;
}
else
{
- // Use the 'real' MSW position
- GetToolBar()->SetSize(0, 0, rect.right, th, wxSIZE_NO_ADJUSTMENTS);
+ tw = rect.right;
}
+
+ // Use the 'real' MSW position here
+ GetToolBar()->SetSize(0, 0, tw, th, wxSIZE_NO_ADJUSTMENTS);
}
*/
}
#endif // wxUSE_TOOLBAR
+// ----------------------------------------------------------------------------
+// frame state (iconized/maximized/...)
+// ----------------------------------------------------------------------------
+
// propagate our state change to all child frames: this allows us to emulate X
// Windows behaviour where child frames float independently of the parent one
// on the desktop, but are iconized/restored with it
}
}
-
-// make the window modal (all other windows unresponsive)
-void wxFrame::MakeModal(bool modal)
-{
- if (modal) {
- wxEnableTopLevelWindows(FALSE);
- Enable(TRUE); // keep this window enabled
- }
- else {
- wxEnableTopLevelWindows(TRUE);
- }
-}
-
-
// ===========================================================================
// message processing
// ===========================================================================
bool wxFrame::OS2TranslateMessage(WXMSG* pMsg)
{
+// TODO:
+/*
if ( wxWindow::OS2TranslateMessage(pMsg) )
return TRUE;
-
+*/
// try the menu bar accels
wxMenuBar *menuBar = GetMenuBar();
if ( !menuBar )
m_iconized = TRUE;
break;
}
-*/
+
if ( !m_iconized )
{
// forward WM_SIZE to status bar control
+#if wxUSE_NATIVE_STATUSBAR
+ if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
+ {
+ wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
+ event.SetEventObject( m_frameStatusBar );
+
+ ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
+ }
+#endif // wxUSE_NATIVE_STATUSBAR
+
PositionStatusBar();
PositionToolBar();
event.SetEventObject( this );
processed = GetEventHandler()->ProcessEvent(event);
}
-
+*/
return processed;
}
bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
+// TODO:
+/*
if ( control )
{
// In case it's e.g. a toolbar.
wxWindow *win = wxFindWinFromHandle(control);
if ( win )
- return win->OS2Command(cmd, id);
+ return win->MSWCommand(cmd, id);
}
// handle here commands from menus and accelerators
wxMenu *popupMenu = wxCurrentPopupMenu;
wxCurrentPopupMenu = NULL;
- return popupMenu->OS2Command(cmd, id);
+ return popupMenu->MSWCommand(cmd, id);
}
if ( ProcessCommand(id) )
return TRUE;
}
}
-
+*/
return FALSE;
}
{
item = nItem;
}
-*/
else
{
// don't give hints for separators (doesn't make sense) nor for the
// items opening popup menus (they don't have them anyhow)
return FALSE;
}
-
+*/
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item);
event.SetEventObject( this );
MRESULT wxFrame::OS2WindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
- MRESULT rc = 0;
+ long rc = 0;
bool processed = FALSE;
// TODO:
processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
break;
}
-*/
+
if ( !processed )
- rc = wxWindow::OS2WindowProc(hwnd, message, wParam, lParam);
+ rc = wxWindow::MSWWindowProc(message, wParam, lParam);
return rc;
+*/
+ return (MRESULT)0;
}
const wxSize& size,
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
int n, const wxString choices[],
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
utilscmn.obj \
valgen.obj \
validate.obj \
- valtext.obj
+ valtext.obj
COMLIBOBJS3 = \
variant.obj \
window.obj
HTMLOBJS = \
+ ..\html\$D\helpctrl.obj \
..\html\$D\helpdata.obj \
..\html\$D\helpfrm.obj \
..\html\$D\htmlcell.obj \
..\html\$D\winpars.obj
HTMLLIBOBJS = \
+ helpctrl.obj \
helpdata.obj \
helpfrm.obj \
htmlcell.obj \
copy ..\generic\$D\treectrl.obj
$(HTMLLIBOBJS):
+ copy ..\html\$D\helpctrl.obj
copy ..\html\$D\helpdata.obj
copy ..\html\$D\helpfrm.obj
copy ..\html\$D\htmlcell.obj
int n, const wxString choices[],
int majorDim, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* val, const wxString& name)
-# else
const wxValidator& val, const wxString& name)
-# endif
#endif
{
m_selectedButton = -1;
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxPoint& pos,
const wxSize& size, long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
const wxSize& size,
long style,
#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
const wxValidator& validator,
-# endif
#endif
const wxString& name)
{
#define INCL_DOSERRORS
#define INCL_DOS
#include <os2.h>
+#define PURE_32
+#include <upm.h>
+#include <netcons.h>
+#include <netbios.h>
#include <ctype.h>
#include <direct.h>
const wxString& rTitle
)
{
- ::WinSetWindowText(GetHwnd(), title.c_str());
+ ::WinSetWindowText(GetHwnd(), rTitle.c_str());
}
wxString wxWindow::GetTitle() const
void wxWindow::CaptureMouse()
{
- // TODO:
+ HWND hWnd = GetHwnd();
+
+ if (hWnd && !m_bWinCaptured)
+ {
+ ::WinSetCapture(HWND_DESKTOP, hWnd);
+ m_bWinCaptured = TRUE;
+ }
}
void wxWindow::ReleaseMouse()
{
- // TODO:
+ if ( m_bWinCaptured )
+ {
+ ::WinSetCapture(HWND_DESKTOP, NULLHANDLE);
+ m_bWinCaptured = FALSE;
+ }
}
-bool wxWindow::SetFont(const wxFont& f)
+bool wxWindow::SetFont(
+ const wxFont& rFont
+)
{
- // TODO:
+ if (!wxWindowBase::SetFont(rFont))
+ {
+ // nothing to do
+ return(FALSE);
+ }
+
+ HWND hWnd = GetHwnd();
+
+ if (hWnd != 0)
+ {
+ wxChar zFont[128];
+
+ sprintf(zFont, "%d.%s", rFont.GetPointSize(), rFont.GetFaceName().c_str());
+ return(::WinSetPresParam(hWnd, PP_FONTNAMESIZE, strlen(zFont), (PVOID)zFont));
+ }
return(TRUE);
}
-bool wxWindow::SetCursor(const wxCursor& cursor) // check if base implementation is OK
+bool wxWindow::SetCursor(
+ const wxCursor& rCursor
+) // check if base implementation is OK
{
- // TODO:
- return(TRUE);
+ if ( !wxWindowBase::SetCursor(rCursor))
+ {
+ // no change
+ return FALSE;
+ }
+
+ wxASSERT_MSG( m_cursor.Ok(),
+ wxT("cursor must be valid after call to the base version"));
+
+ HWND hWnd = GetHwnd();
+ POINTL vPoint;
+ RECTL vRect;
+ HPS hPS;
+ HRGN hRGN;
+
+ hPS = ::WinGetPS(hWnd);
+
+ ::WinQueryPointerPos(HWND_DESKTOP, &vPoint);
+ ::WinQueryWindowRect(hWnd, &vRect);
+
+ hRGN = ::GpiCreateRegion(hPS, 1L, &vRect);
+
+ if ((::GpiPtInRegion(hPS, hRGN, &vPoint) == PRGN_INSIDE) && !wxIsBusy())
+ {
+// ::SetCursor((HCURSOR)m_cursor.GetHCURSOR());
+ }
+ return TRUE;
}
void wxWindow::WarpPointer(int x_pos, int y_pos)
OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB
# Change WXDIR or WXWIN to wherever wxWindows is found
-WXDIR = j:\dev\wx2\wxWindows
+WXDIR = h:\dev\wx2\wxWindows
OS2PNGDIR=$(WXDIR)\src\png
OS2PNGINC=$(WINPNGDIR)
OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB
# Change WXDIR or WXWIN to wherever wxWindows is found
-WXDIR = j:\dev\wx2\wxWindows
+WXDIR = h:\dev\wx2\wxWindows
OS2XPMDIR=$(WXDIR)\src\xpm
OS2XPMINC=$(WINXPMDIR)
OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB
# Change WXDIR or WXWIN to wherever wxWindows is found
-WXDIR = j:\dev\wx2\wxWindows
+WXDIR = h:\dev\wx2\wxWindows
OS2ZLIBDIR=$(WXDIR)\src\zlib
OS2ZLIBINC=$(WINPNGDIR)