MSW compilation fixes - widgets sample runs!
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -192,6 +192,7 @@ prntbase.cpp C
|
|||||||
process.cpp C 32,B
|
process.cpp C 32,B
|
||||||
protocol.cpp C S,B
|
protocol.cpp C S,B
|
||||||
quantize.cpp C
|
quantize.cpp C
|
||||||
|
radiocmn.cpp C
|
||||||
resource.cpp C
|
resource.cpp C
|
||||||
sckaddr.cpp C S,B
|
sckaddr.cpp C S,B
|
||||||
sckfile.cpp C S,B
|
sckfile.cpp C S,B
|
||||||
|
@@ -181,6 +181,14 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* !defined(wxUSE_LISTCTRL) */
|
#endif /* !defined(wxUSE_LISTCTRL) */
|
||||||
|
|
||||||
|
#ifndef wxUSE_MSGDLG
|
||||||
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
|
# error "wxUSE_MSGDLG must be defined."
|
||||||
|
# else
|
||||||
|
# define wxUSE_MSGDLG 0
|
||||||
|
# endif
|
||||||
|
#endif /* !defined(wxUSE_MSGDLG) */
|
||||||
|
|
||||||
#ifndef wxUSE_MDI_ARCHITECTURE
|
#ifndef wxUSE_MDI_ARCHITECTURE
|
||||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
# error "wxUSE_MDI_ARCHITECTURE must be defined."
|
# error "wxUSE_MDI_ARCHITECTURE must be defined."
|
||||||
@@ -457,7 +465,7 @@
|
|||||||
# define wxUSE_FILEDLG 1
|
# define wxUSE_FILEDLG 1
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif /* !wxUSE_FILEDLG */
|
#endif /* wxUSE_FILEDLG */
|
||||||
|
|
||||||
#if !wxUSE_FONTDLG
|
#if !wxUSE_FONTDLG
|
||||||
# if defined(wxUSE_FONTMAP)
|
# if defined(wxUSE_FONTMAP)
|
||||||
@@ -481,6 +489,16 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* !wxUSE_IMAGLIST */
|
#endif /* !wxUSE_IMAGLIST */
|
||||||
|
|
||||||
|
#if !wxUSE_MSGDLG
|
||||||
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
|
/* FIXME: should compile without it, of course, but doesn't */
|
||||||
|
# error "wxMessageBox is always needed"
|
||||||
|
# else
|
||||||
|
# undef wxUSE_MSGDLG
|
||||||
|
# define wxUSE_MSGDLG 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_RADIOBTN
|
#if wxUSE_RADIOBTN
|
||||||
# if defined(__WXUNIVERSAL__) && !wxUSE_CHECKBOX
|
# if defined(__WXUNIVERSAL__) && !wxUSE_CHECKBOX
|
||||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
#pragma interface "datetime.h"
|
#pragma interface "datetime.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_DATETIME
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <limits.h> // for INT_MIN
|
#include <limits.h> // for INT_MIN
|
||||||
|
|
||||||
@@ -1570,4 +1572,6 @@ inline WXDLLEXPORT void wxPrevWDay(wxDateTime::WeekDay& wd)
|
|||||||
: (wxDateTime::WeekDay)(wd - 1);
|
: (wxDateTime::WeekDay)(wd - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_DATETIME
|
||||||
|
|
||||||
#endif // _WX_DATETIME_H
|
#endif // _WX_DATETIME_H
|
||||||
|
@@ -45,15 +45,6 @@ private:
|
|||||||
|
|
||||||
#if !defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__)
|
#if !defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__)
|
||||||
#define wxMessageDialog wxGenericMessageDialog
|
#define wxMessageDialog wxGenericMessageDialog
|
||||||
|
|
||||||
int wxMessageBox( const wxString& message
|
|
||||||
,const wxString& caption = wxMessageBoxCaptionStr
|
|
||||||
,long style = wxOK|wxCENTRE
|
|
||||||
,wxWindow *parent = (wxWindow *) NULL
|
|
||||||
,int x = -1
|
|
||||||
,int y = -1
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#ifndef _WX_MSGDLG_H_BASE_
|
#ifndef _WX_MSGDLG_H_BASE_
|
||||||
#define _WX_MSGDLG_H_BASE_
|
#define _WX_MSGDLG_H_BASE_
|
||||||
|
|
||||||
|
#if wxUSE_MSGDLG
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
#include "wx/msw/msgdlg.h"
|
#include "wx/msw/msgdlg.h"
|
||||||
#elif defined(__WXMOTIF__)
|
#elif defined(__WXMOTIF__)
|
||||||
@@ -17,5 +19,17 @@
|
|||||||
#include "wx/generic/msgdlgg.h"
|
#include "wx/generic/msgdlgg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxMessageBox: the simplest way to use wxMessageDialog
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int WXDLLEXPORT wxMessageBox(const wxString& message,
|
||||||
|
const wxString& caption = wxMessageBoxCaptionStr,
|
||||||
|
long style = wxOK | wxCENTRE,
|
||||||
|
wxWindow *parent = NULL,
|
||||||
|
int x = -1, int y = -1);
|
||||||
|
|
||||||
|
#endif // wxUSE_MSGDLG
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_MSGDLG_H_BASE_
|
// _WX_MSGDLG_H_BASE_
|
||||||
|
@@ -41,9 +41,5 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int WXDLLEXPORT wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
|
||||||
long style = wxOK|wxCENTRE,
|
|
||||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_MSGBOXDLG_H_
|
// _WX_MSGBOXDLG_H_
|
||||||
|
@@ -232,7 +232,7 @@
|
|||||||
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
|
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
|
||||||
#define wxUSE_INTL 1
|
#define wxUSE_INTL 1
|
||||||
|
|
||||||
// Set wxUSE_TIMEDATE to 1 to compile the wxDateTime and related classes which
|
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
|
||||||
// allow to manipulate dates, times and time intervals. wxDateTime replaces the
|
// allow to manipulate dates, times and time intervals. wxDateTime replaces the
|
||||||
// old wxTime and wxDate classes which are still provided for backwards
|
// old wxTime and wxDate classes which are still provided for backwards
|
||||||
// compatibility (and implemented in terms of wxDateTime).
|
// compatibility (and implemented in terms of wxDateTime).
|
||||||
@@ -244,8 +244,19 @@
|
|||||||
//
|
//
|
||||||
// Requires: wxUSE_LONGLONG
|
// Requires: wxUSE_LONGLONG
|
||||||
//
|
//
|
||||||
|
// Default is 1
|
||||||
|
//
|
||||||
// Recommended setting: 1
|
// Recommended setting: 1
|
||||||
#define wxUSE_TIMEDATE 1
|
#define wxUSE_DATETIME 1
|
||||||
|
|
||||||
|
// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not
|
||||||
|
// the same as wxDateTime!). These classes are obsolete and shouldn't be used
|
||||||
|
// in new code
|
||||||
|
//
|
||||||
|
// Default is 0
|
||||||
|
//
|
||||||
|
// Recommended setting: 0 unless you have legacy code which uses these classes
|
||||||
|
#define wxUSE_TIMEDATE 0
|
||||||
|
|
||||||
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
||||||
//
|
//
|
||||||
@@ -539,6 +550,22 @@
|
|||||||
// Recommended setting: 1 (unless it really doesn't work)
|
// Recommended setting: 1 (unless it really doesn't work)
|
||||||
#define wxUSE_COMMON_DIALOGS 1
|
#define wxUSE_COMMON_DIALOGS 1
|
||||||
|
|
||||||
|
// wxBusyInfo displays window with message when app is busy. Works in same way
|
||||||
|
// as wxBusyCursor
|
||||||
|
#define wxUSE_BUSYINFO 1
|
||||||
|
|
||||||
|
// Use single/multiple choice dialogs.
|
||||||
|
//
|
||||||
|
// Default is 1
|
||||||
|
//
|
||||||
|
// Recommended setting: 1 (used in the library itself)
|
||||||
|
#define wxUSE_CHOICEDLG 1
|
||||||
|
|
||||||
|
// wxDirDlg class for getting a directory name from user
|
||||||
|
#define wxUSE_DIRDLG 1
|
||||||
|
|
||||||
|
// TODO: setting to choose the generic or native one
|
||||||
|
|
||||||
// Use file open/save dialogs.
|
// Use file open/save dialogs.
|
||||||
//
|
//
|
||||||
// Default is 1
|
// Default is 1
|
||||||
@@ -553,29 +580,22 @@
|
|||||||
// Recommended setting: 1 (used in the library itself)
|
// Recommended setting: 1 (used in the library itself)
|
||||||
#define wxUSE_FONTDLG 1
|
#define wxUSE_FONTDLG 1
|
||||||
|
|
||||||
// Use single/multiple choice dialogs.
|
// Use wxMessageDialog and wxMessageBox.
|
||||||
//
|
//
|
||||||
// Default is 1
|
// Default is 1
|
||||||
//
|
//
|
||||||
// Recommended setting: 1 (used in the library itself)
|
// Recommended setting: 1 (used in the library itself)
|
||||||
#define wxUSE_CHOICEDLG 1
|
#define wxUSE_MSGDLG 1
|
||||||
|
|
||||||
// text entry dialog and wxGetTextFromUser function
|
|
||||||
#define wxUSE_TEXTDLG 1
|
|
||||||
|
|
||||||
// progress dialog class for lengthy operations
|
// progress dialog class for lengthy operations
|
||||||
#define wxUSE_PROGRESSDLG 1
|
#define wxUSE_PROGRESSDLG 1
|
||||||
|
|
||||||
// wxBusyInfo displays window with message when app is busy. Works in same way
|
|
||||||
// as wxBusyCursor
|
|
||||||
#define wxUSE_BUSYINFO 1
|
|
||||||
|
|
||||||
// wxDirDlg class for getting a directory name from user
|
|
||||||
#define wxUSE_DIRDLG 1
|
|
||||||
|
|
||||||
// support for startup tips (wxShowTip &c)
|
// support for startup tips (wxShowTip &c)
|
||||||
#define wxUSE_STARTUP_TIPS 1
|
#define wxUSE_STARTUP_TIPS 1
|
||||||
|
|
||||||
|
// text entry dialog and wxGetTextFromUser function
|
||||||
|
#define wxUSE_TEXTDLG 1
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Metafiles support
|
// Metafiles support
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1073,7 +1093,7 @@
|
|||||||
// you need to modify setup.h and rebuild everything
|
// you need to modify setup.h and rebuild everything
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_TIMEDATE && !wxUSE_LONGLONG
|
#if wxUSE_DATETIME && !wxUSE_LONGLONG
|
||||||
#error wxDateTime requires wxLongLong
|
#error wxDateTime requires wxLongLong
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -112,7 +112,9 @@ public:
|
|||||||
void HandleOnChar(wxKeyEvent& event);
|
void HandleOnChar(wxKeyEvent& event);
|
||||||
void HandleOnMouseEnter(wxMouseEvent& event);
|
void HandleOnMouseEnter(wxMouseEvent& event);
|
||||||
void HandleOnMouseLeave(wxMouseEvent& event);
|
void HandleOnMouseLeave(wxMouseEvent& event);
|
||||||
|
#if wxUSE_MOUSEWHEEL
|
||||||
void HandleOnMouseWheel(wxMouseEvent& event);
|
void HandleOnMouseWheel(wxMouseEvent& event);
|
||||||
|
#endif // wxUSE_MOUSEWHEEL
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// get pointer to our scroll rect if we use it or NULL
|
// get pointer to our scroll rect if we use it or NULL
|
||||||
@@ -158,6 +160,10 @@ protected:
|
|||||||
|
|
||||||
double m_scaleX;
|
double m_scaleX;
|
||||||
double m_scaleY;
|
double m_scaleY;
|
||||||
|
|
||||||
|
#if wxUSE_MOUSEWHEEL
|
||||||
|
int m_wheelRotation;
|
||||||
|
#endif // wxUSE_MOUSEWHEEL
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -25,8 +25,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <wx/wx.h>
|
#include <wx/app.h>
|
||||||
|
#include <wx/frame.h>
|
||||||
|
#include <wx/menu.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
#include <wx/textctrl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !wxUSE_MENUS
|
#if !wxUSE_MENUS
|
||||||
@@ -41,9 +44,6 @@
|
|||||||
|
|
||||||
WX_USE_THEME(win32);
|
WX_USE_THEME(win32);
|
||||||
WX_USE_THEME(gtk);
|
WX_USE_THEME(gtk);
|
||||||
|
|
||||||
// not implemented yet
|
|
||||||
#define wxMessageBox
|
|
||||||
#endif // __WXUNIVERSAL__
|
#endif // __WXUNIVERSAL__
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -67,7 +67,10 @@ public:
|
|||||||
|
|
||||||
void LogMenuEvent(const wxCommandEvent& event);
|
void LogMenuEvent(const wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
void OnClearLog(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnDummy(wxCommandEvent& event);
|
void OnDummy(wxCommandEvent& event);
|
||||||
@@ -90,19 +93,29 @@ public:
|
|||||||
void OnGetLabelMenu(wxCommandEvent& event);
|
void OnGetLabelMenu(wxCommandEvent& event);
|
||||||
void OnSetLabelMenu(wxCommandEvent& event);
|
void OnSetLabelMenu(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnRightDown(wxMouseEvent& event);
|
void OnRightUp(wxMouseEvent& event);
|
||||||
|
|
||||||
void OnUpdateCheckMenuItemUI(wxUpdateUIEvent& event);
|
void OnUpdateCheckMenuItemUI(wxUpdateUIEvent& event);
|
||||||
|
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxMenu *CreateDummyMenu(wxString *title);
|
wxMenu *CreateDummyMenu(wxString *title);
|
||||||
|
|
||||||
wxMenuItem *GetLastMenuItem() const;
|
wxMenuItem *GetLastMenuItem() const;
|
||||||
|
|
||||||
|
// the menu previously detached from the menubar (may be NULL)
|
||||||
wxMenu *m_menu;
|
wxMenu *m_menu;
|
||||||
|
|
||||||
|
// the count of dummy menus already created
|
||||||
size_t m_countDummy;
|
size_t m_countDummy;
|
||||||
|
|
||||||
|
// the control used for logging
|
||||||
|
wxTextCtrl *m_textctrl;
|
||||||
|
|
||||||
|
// the previous log target
|
||||||
|
wxLog *m_logOld;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,6 +145,7 @@ private:
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
Menu_File_Quit = 100,
|
Menu_File_Quit = 100,
|
||||||
|
Menu_File_ClearLog,
|
||||||
|
|
||||||
Menu_MenuBar_Toggle = 200,
|
Menu_MenuBar_Toggle = 200,
|
||||||
Menu_MenuBar_Append,
|
Menu_MenuBar_Append,
|
||||||
@@ -173,6 +187,7 @@ enum
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
EVT_MENU(Menu_File_Quit, MyFrame::OnQuit)
|
EVT_MENU(Menu_File_Quit, MyFrame::OnQuit)
|
||||||
|
EVT_MENU(Menu_File_ClearLog, MyFrame::OnClearLog)
|
||||||
|
|
||||||
EVT_MENU(Menu_Help_About, MyFrame::OnAbout)
|
EVT_MENU(Menu_Help_About, MyFrame::OnAbout)
|
||||||
|
|
||||||
@@ -198,7 +213,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
|
|
||||||
EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
|
EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
|
||||||
|
|
||||||
EVT_RIGHT_DOWN(MyFrame::OnRightDown)
|
EVT_RIGHT_UP(MyFrame::OnRightUp)
|
||||||
|
|
||||||
|
EVT_SIZE(MyFrame::OnSize)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
|
BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
|
||||||
@@ -225,7 +242,7 @@ bool MyApp::OnInit()
|
|||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
frame->SetStatusText("Hello, wxWindows");
|
frame->SetStatusText("Welcome to wxWindows menu sample");
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
@@ -244,19 +261,21 @@ MyFrame::MyFrame()
|
|||||||
{
|
{
|
||||||
m_menu = NULL;
|
m_menu = NULL;
|
||||||
m_countDummy = 0;
|
m_countDummy = 0;
|
||||||
|
m_logOld = NULL;
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
CreateStatusBar(2);
|
CreateStatusBar();
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
// create the menubar
|
// create the menubar
|
||||||
wxMenu *fileMenu = new wxMenu;
|
wxMenu *fileMenu = new wxMenu;
|
||||||
fileMenu->Append(Menu_File_Quit, "E&xit\tAlt-X", "Quit toolbar sample");
|
|
||||||
|
|
||||||
wxMenuItem *itemBitmap = new wxMenuItem(fileMenu, Menu_File_Quit,
|
wxMenuItem *item = new wxMenuItem(fileMenu, Menu_File_ClearLog,
|
||||||
"Quit with &bitmap\tAlt-Q");
|
"Clear &log\tCtrl-L");
|
||||||
itemBitmap->SetBitmap(wxBitmap(copy_xpm));
|
item->SetBitmap(copy_xpm);
|
||||||
fileMenu->Append(itemBitmap);
|
fileMenu->Append(item);
|
||||||
|
fileMenu->AppendSeparator();
|
||||||
|
fileMenu->Append(Menu_File_Quit, "E&xit\tAlt-X", "Quit menu sample");
|
||||||
|
|
||||||
wxMenu *menubarMenu = new wxMenu;
|
wxMenu *menubarMenu = new wxMenu;
|
||||||
menubarMenu->Append(Menu_MenuBar_Append, "&Append menu\tCtrl-A",
|
menubarMenu->Append(Menu_MenuBar_Append, "&Append menu\tCtrl-A",
|
||||||
@@ -320,6 +339,19 @@ MyFrame::MyFrame()
|
|||||||
|
|
||||||
// intercept all menu events and log them in this custom event handler
|
// intercept all menu events and log them in this custom event handler
|
||||||
PushEventHandler(new MyEvtHandler(this));
|
PushEventHandler(new MyEvtHandler(this));
|
||||||
|
|
||||||
|
// create the log text window
|
||||||
|
m_textctrl = new wxTextCtrl(this, -1, _T(""),
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
wxTE_MULTILINE);
|
||||||
|
m_textctrl->SetEditable(FALSE);
|
||||||
|
m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl));
|
||||||
|
|
||||||
|
wxLogMessage(_T("Brief explanations: the commands or the \"Menu\" menu\n")
|
||||||
|
_T("append/insert/delete items to/from the last menu.\n")
|
||||||
|
_T("The commands from \"Menubar\" menu work with the\n")
|
||||||
|
_T("menubar itself.\n")
|
||||||
|
_T("Right click the band below to test popup menus.\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
MyFrame::~MyFrame()
|
MyFrame::~MyFrame()
|
||||||
@@ -328,14 +360,17 @@ MyFrame::~MyFrame()
|
|||||||
|
|
||||||
// delete the event handler installed in ctor
|
// delete the event handler installed in ctor
|
||||||
PopEventHandler(TRUE);
|
PopEventHandler(TRUE);
|
||||||
|
|
||||||
|
// restore old logger
|
||||||
|
delete wxLog::SetActiveTarget(m_logOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenu *MyFrame::CreateDummyMenu(wxString *title)
|
wxMenu *MyFrame::CreateDummyMenu(wxString *title)
|
||||||
{
|
{
|
||||||
wxMenu *menu = new wxMenu;
|
wxMenu *menu = new wxMenu;
|
||||||
menu->Append(Menu_Dummy_First, "First item\tCtrl-F1");
|
menu->Append(Menu_Dummy_First, "&First item\tCtrl-F1");
|
||||||
menu->AppendSeparator();
|
menu->AppendSeparator();
|
||||||
menu->Append(Menu_Dummy_Second, "Second item\tCtrl-F2", "", TRUE);
|
menu->Append(Menu_Dummy_Second, "&Second item\tCtrl-F2", "", TRUE);
|
||||||
|
|
||||||
if ( title )
|
if ( title )
|
||||||
{
|
{
|
||||||
@@ -368,6 +403,7 @@ void MyFrame::LogMenuEvent(const wxCommandEvent& event)
|
|||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
if ( !GetMenuBar()->FindItem(id) )
|
if ( !GetMenuBar()->FindItem(id) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxString msg = wxString::Format("Menu command %d", id);
|
wxString msg = wxString::Format("Menu command %d", id);
|
||||||
if ( GetMenuBar()->FindItem(id)->IsCheckable() )
|
if ( GetMenuBar()->FindItem(id)->IsCheckable() )
|
||||||
{
|
{
|
||||||
@@ -375,9 +411,7 @@ void MyFrame::LogMenuEvent(const wxCommandEvent& event)
|
|||||||
event.IsChecked() ? "" : "not ");
|
event.IsChecked() ? "" : "not ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
wxLogMessage(msg);
|
||||||
SetStatusText(msg, 1);
|
|
||||||
#endif // wxUSE_STATUSBAR
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -389,11 +423,21 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
|||||||
Close(TRUE);
|
Close(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnClearLog(wxCommandEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
m_textctrl->Clear();
|
||||||
|
}
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
(void)wxMessageBox("wxWindows toolbar sample",
|
#ifdef __WXUNIVERSAL__
|
||||||
|
// wxMessageBox not implemented yet
|
||||||
|
wxLogMessage("wxWindows menu sample\n<EFBFBD> 1999-2001 Vadim Zeitlin");
|
||||||
|
#else
|
||||||
|
(void)wxMessageBox("wxWindows menu sample\n<EFBFBD> 1999-2001 Vadim Zeitlin",
|
||||||
"About wxWindows menu sample",
|
"About wxWindows menu sample",
|
||||||
wxICON_INFORMATION);
|
wxICON_INFORMATION);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnDeleteMenu(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnDeleteMenu(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -442,15 +486,12 @@ void MyFrame::OnToggleMenu(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnEnableMenu(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnEnableMenu(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxMenuBar *mbar = GetMenuBar();
|
wxMenuBar *mbar = GetMenuBar();
|
||||||
size_t count = mbar->GetMenuCount();
|
size_t count = mbar->GetMenuCount();
|
||||||
|
|
||||||
static bool s_enabled = TRUE;
|
mbar->EnableTop(count - 1, event.IsChecked());
|
||||||
|
|
||||||
s_enabled = !s_enabled;
|
|
||||||
mbar->EnableTop(count - 1, s_enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnGetLabelMenu(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnGetLabelMenu(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -472,9 +513,7 @@ void MyFrame::OnSetLabelMenu(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void MyFrame::OnDummy(wxCommandEvent& event)
|
void MyFrame::OnDummy(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxString s;
|
wxLogMessage("Dummy item #%d", event.GetId() - Menu_Dummy_First + 1);
|
||||||
s.Printf("Dummy item #%d", event.GetId() - Menu_Dummy_First + 1);
|
|
||||||
wxMessageBox(s, "Menu sample", wxICON_INFORMATION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -483,7 +522,7 @@ void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
|
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
|
||||||
|
|
||||||
menu->AppendSeparator();
|
menu->AppendSeparator();
|
||||||
menu->Append(Menu_Dummy_Third, "Third dummy item\tCtrl-F3",
|
menu->Append(Menu_Dummy_Third, "&Third dummy item\tCtrl-F3",
|
||||||
"Checkable item", TRUE);
|
"Checkable item", TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +532,7 @@ void MyFrame::OnAppendSubMenu(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
|
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
|
||||||
|
|
||||||
menu->Append(Menu_Dummy_Last, "Dummy sub menu",
|
menu->Append(Menu_Dummy_Last, "&Dummy sub menu",
|
||||||
CreateDummyMenu(NULL), "Dummy sub menu help");
|
CreateDummyMenu(NULL), "Dummy sub menu help");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,15 +684,15 @@ void MyFrame::OnGetMenuItemInfo(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnRightDown(wxMouseEvent &event )
|
void MyFrame::OnRightUp(wxMouseEvent &event)
|
||||||
{
|
{
|
||||||
wxMenu menu("Test popup");
|
wxMenu menu("Test popup");
|
||||||
|
|
||||||
menu.Append(Menu_Help_About, "&About");
|
menu.Append(Menu_Help_About, "&About");
|
||||||
menu.Append(Menu_Popup_Submenu, "Submenu", CreateDummyMenu(NULL));
|
menu.Append(Menu_Popup_Submenu, "&Submenu", CreateDummyMenu(NULL));
|
||||||
menu.Append(Menu_Popup_ToBeDeleted, "To be deleted");
|
menu.Append(Menu_Popup_ToBeDeleted, "To be &deleted");
|
||||||
menu.Append(Menu_Popup_ToBeChecked, "To be checked", "", TRUE);
|
menu.Append(Menu_Popup_ToBeChecked, "To be &checked", "", TRUE);
|
||||||
menu.Append(Menu_Popup_ToBeGreyed, "To be greyed");
|
menu.Append(Menu_Popup_ToBeGreyed, "To be &greyed");
|
||||||
menu.AppendSeparator();
|
menu.AppendSeparator();
|
||||||
menu.Append(Menu_File_Quit, "E&xit");
|
menu.Append(Menu_File_Quit, "E&xit");
|
||||||
|
|
||||||
@@ -664,9 +703,24 @@ void MyFrame::OnRightDown(wxMouseEvent &event )
|
|||||||
PopupMenu(&menu, event.GetX(), event.GetY());
|
PopupMenu(&menu, event.GetX(), event.GetY());
|
||||||
|
|
||||||
// test for destroying items in popup menus
|
// test for destroying items in popup menus
|
||||||
#if 0
|
#if 0 // doesn't work in wxGTK!
|
||||||
menu.Destroy(Menu_Popup_Submenu);
|
menu.Destroy(Menu_Popup_Submenu);
|
||||||
|
|
||||||
PopupMenu( &menu, event.GetX(), event.GetY() );
|
PopupMenu( &menu, event.GetX(), event.GetY() );
|
||||||
#endif // 0
|
#endif // 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnSize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
// leave a band below for popup menu testing
|
||||||
|
wxSize size = GetClientSize();
|
||||||
|
m_textctrl->SetSize(0, 0, size.x, (3*size.y)/4);
|
||||||
|
|
||||||
|
// this is really ugly but we have to do it as we can't just call
|
||||||
|
// event.Skip() because wxFrameBase would make the text control fill the
|
||||||
|
// entire frame then
|
||||||
|
#ifdef __WXUNIVERSAL__
|
||||||
|
PositionMenuBar();
|
||||||
|
#endif // __WXUNIVERSAL__
|
||||||
|
}
|
||||||
|
|
||||||
|
138
src/common/radiocmn.cpp
Normal file
138
src/common/radiocmn.cpp
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: src/common/radiocmn.cpp
|
||||||
|
// Purpose: wxRadioBox methods common to all ports
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 03.06.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// License: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "radioboxbase.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_RADIOBOX
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/radiobox.h"
|
||||||
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const
|
||||||
|
{
|
||||||
|
int count = GetCount(),
|
||||||
|
numCols = GetColumnCount(),
|
||||||
|
numRows = GetRowCount();
|
||||||
|
|
||||||
|
bool horz = (style & wxRA_SPECIFY_COLS) != 0;
|
||||||
|
|
||||||
|
switch ( dir )
|
||||||
|
{
|
||||||
|
case wxUP:
|
||||||
|
if ( horz )
|
||||||
|
{
|
||||||
|
item -= numCols;
|
||||||
|
}
|
||||||
|
else // vertical layout
|
||||||
|
{
|
||||||
|
if ( !item-- )
|
||||||
|
item = count - 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxLEFT:
|
||||||
|
if ( horz )
|
||||||
|
{
|
||||||
|
if ( !item-- )
|
||||||
|
item = count - 1;
|
||||||
|
}
|
||||||
|
else // vertical layout
|
||||||
|
{
|
||||||
|
item -= numRows;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxDOWN:
|
||||||
|
if ( horz )
|
||||||
|
{
|
||||||
|
item += numCols;
|
||||||
|
}
|
||||||
|
else // vertical layout
|
||||||
|
{
|
||||||
|
if ( ++item == count )
|
||||||
|
item = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxRIGHT:
|
||||||
|
if ( horz )
|
||||||
|
{
|
||||||
|
if ( ++item == count )
|
||||||
|
item = 0;
|
||||||
|
}
|
||||||
|
else // vertical layout
|
||||||
|
{
|
||||||
|
item += numRows;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG( _T("unexpected wxDirection value") );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ensure that the item is in range [0..count)
|
||||||
|
if ( item < 0 )
|
||||||
|
{
|
||||||
|
// first map the item to the one in the same column but in the last row
|
||||||
|
item += count;
|
||||||
|
|
||||||
|
// now there are 2 cases: either it is the first item of the last row
|
||||||
|
// in which case we need to wrap again and get to the last item or we
|
||||||
|
// can just go to the previous item
|
||||||
|
if ( item % (horz ? numCols : numRows) )
|
||||||
|
item--;
|
||||||
|
else
|
||||||
|
item = count - 1;
|
||||||
|
}
|
||||||
|
else if ( item >= count )
|
||||||
|
{
|
||||||
|
// same logic as above
|
||||||
|
item -= count;
|
||||||
|
|
||||||
|
// ... except that we need to check if this is not the last item, not
|
||||||
|
// the first one
|
||||||
|
if ( (item + 1) % (horz ? numCols : numRows) )
|
||||||
|
item++;
|
||||||
|
else
|
||||||
|
item = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxASSERT_MSG( item < count && item >= 0,
|
||||||
|
_T("logic error in wxRadioBox::GetNextItem()") );
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_RADIOBOX
|
||||||
|
|
@@ -174,42 +174,49 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
|
|||||||
// ProcessEvent() above
|
// ProcessEvent() above
|
||||||
event.Skip(FALSE);
|
event.Skip(FALSE);
|
||||||
|
|
||||||
switch ( event.GetEventType() )
|
wxEventType evType = event.GetEventType();
|
||||||
{
|
|
||||||
case wxEVT_SCROLLWIN_TOP:
|
|
||||||
case wxEVT_SCROLLWIN_BOTTOM:
|
|
||||||
case wxEVT_SCROLLWIN_LINEUP:
|
|
||||||
case wxEVT_SCROLLWIN_LINEDOWN:
|
|
||||||
case wxEVT_SCROLLWIN_PAGEUP:
|
|
||||||
case wxEVT_SCROLLWIN_PAGEDOWN:
|
|
||||||
case wxEVT_SCROLLWIN_THUMBTRACK:
|
|
||||||
case wxEVT_SCROLLWIN_THUMBRELEASE:
|
|
||||||
m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event);
|
|
||||||
return !event.GetSkipped();
|
|
||||||
|
|
||||||
case wxEVT_PAINT:
|
if ( evType == wxEVT_PAINT )
|
||||||
|
{
|
||||||
m_scrollHelper->HandleOnPaint((wxPaintEvent &)event);
|
m_scrollHelper->HandleOnPaint((wxPaintEvent &)event);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case wxEVT_SIZE:
|
if ( evType == wxEVT_SCROLLWIN_TOP ||
|
||||||
|
evType == wxEVT_SCROLLWIN_BOTTOM ||
|
||||||
|
evType == wxEVT_SCROLLWIN_LINEUP ||
|
||||||
|
evType == wxEVT_SCROLLWIN_LINEDOWN ||
|
||||||
|
evType == wxEVT_SCROLLWIN_PAGEUP ||
|
||||||
|
evType == wxEVT_SCROLLWIN_PAGEDOWN ||
|
||||||
|
evType == wxEVT_SCROLLWIN_THUMBTRACK ||
|
||||||
|
evType == wxEVT_SCROLLWIN_THUMBRELEASE )
|
||||||
|
{
|
||||||
|
m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event);
|
||||||
|
return !event.GetSkipped();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( evType == wxEVT_ENTER_WINDOW )
|
||||||
|
{
|
||||||
|
m_scrollHelper->HandleOnMouseEnter((wxMouseEvent &)event);
|
||||||
|
}
|
||||||
|
else if ( evType == wxEVT_LEAVE_WINDOW )
|
||||||
|
{
|
||||||
|
m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event);
|
||||||
|
}
|
||||||
|
#if wxUSE_MOUSEWHEEL
|
||||||
|
else if ( evType == wxEVT_MOUSEWHEEL )
|
||||||
|
{
|
||||||
|
m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event);
|
||||||
|
}
|
||||||
|
#endif // wxUSE_MOUSEWHEEL
|
||||||
|
else if ( evType == wxEVT_SIZE )
|
||||||
|
{
|
||||||
m_scrollHelper->HandleOnSize((wxSizeEvent &)event);
|
m_scrollHelper->HandleOnSize((wxSizeEvent &)event);
|
||||||
return FALSE;
|
}
|
||||||
|
else if ( evType == wxEVT_CHAR )
|
||||||
case wxEVT_CHAR:
|
{
|
||||||
m_scrollHelper->HandleOnChar((wxKeyEvent &)event);
|
m_scrollHelper->HandleOnChar((wxKeyEvent &)event);
|
||||||
return !event.GetSkipped();
|
return !event.GetSkipped();
|
||||||
|
|
||||||
case wxEVT_ENTER_WINDOW:
|
|
||||||
m_scrollHelper->HandleOnMouseEnter((wxMouseEvent &)event);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case wxEVT_LEAVE_WINDOW:
|
|
||||||
m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case wxEVT_MOUSEWHEEL:
|
|
||||||
m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -937,6 +944,8 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_MOUSEWHEEL
|
||||||
|
|
||||||
void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event)
|
void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
m_wheelRotation += event.GetWheelRotation();
|
m_wheelRotation += event.GetWheelRotation();
|
||||||
@@ -953,6 +962,8 @@ void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_MOUSEWHEEL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxGenericScrolledWindow implementation
|
// wxGenericScrolledWindow implementation
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -784,7 +784,7 @@ void wxHtmlWidgetCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
|
|||||||
c = c->GetParent();
|
c = c->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
((wxScrolledWindow*)(m_Wnd->GetParent()))->ViewStart(&stx, &sty);
|
((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty);
|
||||||
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
||||||
|
|
||||||
wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
|
wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
|
||||||
@@ -804,7 +804,7 @@ void wxHtmlWidgetCell::DrawInvisible(wxDC& dc, int x, int y)
|
|||||||
c = c->GetParent();
|
c = c->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
((wxScrolledWindow*)(m_Wnd->GetParent()))->ViewStart(&stx, &sty);
|
((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty);
|
||||||
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
||||||
|
|
||||||
wxHtmlCell::DrawInvisible(dc, x, y);
|
wxHtmlCell::DrawInvisible(dc, x, y);
|
||||||
|
@@ -209,7 +209,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
|||||||
{
|
{
|
||||||
// store scroll position into history item:
|
// store scroll position into history item:
|
||||||
int x, y;
|
int x, y;
|
||||||
ViewStart(&x, &y);
|
GetViewStart(&x, &y);
|
||||||
(*m_History)[m_HistoryPos].SetPos(y);
|
(*m_History)[m_HistoryPos].SetPos(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,8 +251,6 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
|||||||
|
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
{
|
{
|
||||||
wxString err;
|
|
||||||
|
|
||||||
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
|
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
|
||||||
m_tmpCanDrawLocks--;
|
m_tmpCanDrawLocks--;
|
||||||
|
|
||||||
@@ -465,7 +463,7 @@ bool wxHtmlWindow::HistoryBack()
|
|||||||
|
|
||||||
// store scroll position into history item:
|
// store scroll position into history item:
|
||||||
int x, y;
|
int x, y;
|
||||||
ViewStart(&x, &y);
|
GetViewStart(&x, &y);
|
||||||
(*m_History)[m_HistoryPos].SetPos(y);
|
(*m_History)[m_HistoryPos].SetPos(y);
|
||||||
|
|
||||||
// go to previous position:
|
// go to previous position:
|
||||||
@@ -624,7 +622,7 @@ void wxHtmlWindow::OnDraw(wxDC& dc)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
ViewStart(&x, &y);
|
GetViewStart(&x, &y);
|
||||||
|
|
||||||
while (upd)
|
while (upd)
|
||||||
{
|
{
|
||||||
@@ -656,7 +654,7 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event)
|
|||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
wxString lnk;
|
wxString lnk;
|
||||||
|
|
||||||
ViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
GetViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
||||||
pos = event.GetPosition();
|
pos = event.GetPosition();
|
||||||
|
|
||||||
if (m_Cell)
|
if (m_Cell)
|
||||||
@@ -680,7 +678,7 @@ void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
|
|||||||
int x, y;
|
int x, y;
|
||||||
wxHtmlLinkInfo *lnk;
|
wxHtmlLinkInfo *lnk;
|
||||||
|
|
||||||
ViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
GetViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
||||||
wxGetMousePosition(&x, &y);
|
wxGetMousePosition(&x, &y);
|
||||||
ScreenToClient(&x, &y);
|
ScreenToClient(&x, &y);
|
||||||
lnk = m_Cell->GetLink(sx + x, sy + y);
|
lnk = m_Cell->GetLink(sx + x, sy + y);
|
||||||
|
112
src/msw/font.cpp
112
src/msw/font.cpp
@@ -645,115 +645,11 @@ wxFontEncoding wxFont::GetEncoding() const
|
|||||||
return M_FONTDATA->m_encoding;
|
return M_FONTDATA->m_encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
wxNativeFontInfo *wxFont::GetNativeFontInfo() const
|
||||||
// wxNativeFontInfo
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool wxNativeFontInfo::FromString(const wxString& s)
|
|
||||||
{
|
{
|
||||||
long l;
|
if( M_FONTDATA->m_nativeFontInfoOk )
|
||||||
|
return new wxNativeFontInfo(M_FONTDATA->m_nativeFontInfo);
|
||||||
|
|
||||||
wxStringTokenizer tokenizer(s, _T(";"));
|
return 0;
|
||||||
|
|
||||||
wxString token = tokenizer.GetNextToken();
|
|
||||||
//
|
|
||||||
// Ignore the version for now
|
|
||||||
//
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfHeight = l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfWidth = l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfEscapement = l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfOrientation = l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfWeight = l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfItalic = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfUnderline = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfStrikeOut = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfCharSet = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfOutPrecision = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfClipPrecision = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfQuality = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if ( !token.ToLong(&l) )
|
|
||||||
return FALSE;
|
|
||||||
lf.lfPitchAndFamily = (BYTE)l;
|
|
||||||
|
|
||||||
token = tokenizer.GetNextToken();
|
|
||||||
if(!token)
|
|
||||||
return FALSE;
|
|
||||||
wxStrcpy(lf.lfFaceName, token.c_str());
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString wxNativeFontInfo::ToString() const
|
|
||||||
{
|
|
||||||
wxString s;
|
|
||||||
|
|
||||||
s.Printf(_T("%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%s"),
|
|
||||||
0, // version, in case we want to change the format later
|
|
||||||
lf.lfHeight,
|
|
||||||
lf.lfWidth,
|
|
||||||
lf.lfEscapement,
|
|
||||||
lf.lfOrientation,
|
|
||||||
lf.lfWeight,
|
|
||||||
lf.lfItalic,
|
|
||||||
lf.lfUnderline,
|
|
||||||
lf.lfStrikeOut,
|
|
||||||
lf.lfCharSet,
|
|
||||||
lf.lfOutPrecision,
|
|
||||||
lf.lfClipPrecision,
|
|
||||||
lf.lfQuality,
|
|
||||||
lf.lfPitchAndFamily,
|
|
||||||
lf.lfFaceName);
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1992,7 +1992,8 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lvItem.pszText = info.m_text;
|
// pszText is not const, hence the cast
|
||||||
|
lvItem.pszText = (wxChar *)info.m_text.c_str();
|
||||||
if ( lvItem.pszText )
|
if ( lvItem.pszText )
|
||||||
lvItem.cchTextMax = info.m_text.Length();
|
lvItem.cchTextMax = info.m_text.Length();
|
||||||
else
|
else
|
||||||
|
@@ -196,7 +196,8 @@ bool wxNotebook::Create(wxWindow *parent,
|
|||||||
// dtor
|
// dtor
|
||||||
wxNotebook::~wxNotebook()
|
wxNotebook::~wxNotebook()
|
||||||
{
|
{
|
||||||
if (m_bOwnsImageList) delete m_pImageList;
|
if (m_bOwnsImageList)
|
||||||
|
delete m_imageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -85,9 +85,11 @@ static wxString ConvertStringFromOle(BSTR bStr);
|
|||||||
static int rgMonthDays[13] =
|
static int rgMonthDays[13] =
|
||||||
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
|
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
|
||||||
|
|
||||||
|
#if wxUSE_TIMEDATE
|
||||||
static BOOL OleDateFromTm(WORD wYear, WORD wMonth, WORD wDay,
|
static BOOL OleDateFromTm(WORD wYear, WORD wMonth, WORD wDay,
|
||||||
WORD wHour, WORD wMinute, WORD wSecond, DATE& dtDest);
|
WORD wHour, WORD wMinute, WORD wSecond, DATE& dtDest);
|
||||||
static BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest);
|
static BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest);
|
||||||
|
#endif // wxUSE_TIMEDATE
|
||||||
|
|
||||||
static void ClearVariant(VARIANTARG *pvarg) ;
|
static void ClearVariant(VARIANTARG *pvarg) ;
|
||||||
static void ReleaseVariant(VARIANTARG *pvarg) ;
|
static void ReleaseVariant(VARIANTARG *pvarg) ;
|
||||||
|
@@ -905,14 +905,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
|||||||
|
|
||||||
bool processed = TRUE;
|
bool processed = TRUE;
|
||||||
|
|
||||||
bool horz = (radiobox->GetWindowStyle() & wxRA_SPECIFY_COLS) != 0;
|
wxDirection dir;
|
||||||
int num = radiobox->Number(),
|
|
||||||
rows = radiobox->GetNumVer(),
|
|
||||||
cols = radiobox->GetNumHor();
|
|
||||||
|
|
||||||
int selOld = radiobox->GetSelection();
|
|
||||||
int selNew = selOld;
|
|
||||||
|
|
||||||
switch ( wParam )
|
switch ( wParam )
|
||||||
{
|
{
|
||||||
case VK_UP:
|
case VK_UP:
|
||||||
@@ -948,17 +941,6 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
|||||||
radiobox->GetWindowStyle()
|
radiobox->GetWindowStyle()
|
||||||
);
|
);
|
||||||
|
|
||||||
int dim = horz ? cols : rows;
|
|
||||||
if ( selNew % dim == 0 )
|
|
||||||
{
|
|
||||||
selNew -= dim - 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
selNew++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( selNew != selOld )
|
if ( selNew != selOld )
|
||||||
{
|
{
|
||||||
radiobox->SetSelection(selNew);
|
radiobox->SetSelection(selNew);
|
||||||
@@ -1012,7 +994,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // __WIN32__
|
||||||
}
|
}
|
||||||
|
|
||||||
return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn, hwnd, message, wParam, lParam);
|
return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn, hwnd, message, wParam, lParam);
|
||||||
|
@@ -166,8 +166,6 @@ static bool IsMouseInWindow(HWND hwnd);
|
|||||||
// event tables
|
// event tables
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
|
|
||||||
|
|
||||||
// in wxUniv/MSW this class is abstract because it doesn't have DoPopupMenu()
|
// in wxUniv/MSW this class is abstract because it doesn't have DoPopupMenu()
|
||||||
// method
|
// method
|
||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
|
Reference in New Issue
Block a user