removed SetAutoLayout(true) calls when a corresponding SetSizer() was also called (the latter already calls SetAutoLayout(true) in case of a non-NULL window); usual cleanup: removing tabs and end of line whitespace, TRUE->true, FALSE->false, -1->wxID_ANY, Enable(false)->Disable(), ""->wxEmptyString
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -75,7 +75,7 @@ bool MyApp::OnInit(void)
|
|||||||
m_mainFrame->Show(true);
|
m_mainFrame->Show(true);
|
||||||
|
|
||||||
SetTopWindow(m_mainFrame);
|
SetTopWindow(m_mainFrame);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ void MyApp::PropertyFormTest(bool useDialog)
|
|||||||
panel->SetConstraints(c);
|
panel->SetConstraints(c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add items to the panel
|
// Add items to the panel
|
||||||
wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxDefaultPosition,
|
wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxDefaultPosition,
|
||||||
wxSize(80, 26), 0, wxDefaultValidator, _T("ok"));
|
wxSize(80, 26), 0, wxDefaultValidator, _T("ok"));
|
||||||
@@ -306,7 +306,7 @@ void MyApp::PropertyFormTest(bool useDialog)
|
|||||||
okButton->SetConstraints(c);
|
okButton->SetConstraints(c);
|
||||||
|
|
||||||
// The name of this text item matches the "fred" property
|
// The name of this text item matches the "fred" property
|
||||||
wxTextCtrl *text = new wxTextCtrl(panel, wxID_ANY, _T("Fred"), wxDefaultPosition,
|
wxTextCtrl *text = new wxTextCtrl(panel, wxID_ANY, _T("Fred"), wxDefaultPosition,
|
||||||
wxSize( 200, wxDefaultSize.y), 0, wxDefaultValidator, _T("fred"));
|
wxSize( 200, wxDefaultSize.y), 0, wxDefaultValidator, _T("fred"));
|
||||||
|
|
||||||
c = new wxLayoutConstraints;
|
c = new wxLayoutConstraints;
|
||||||
|
@@ -29,13 +29,13 @@ bool MyApp::OnInit()
|
|||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
|
||||||
|
|
||||||
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"),
|
sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"),
|
||||||
wxDefaultPosition,wxSize(300,200)),
|
wxDefaultPosition,wxSize(300,200)),
|
||||||
1, wxEXPAND|wxALL, 10);
|
1, wxEXPAND|wxALL, 10);
|
||||||
|
|
||||||
sizer->Add(5,5);
|
sizer->Add(5,5);
|
||||||
|
|
||||||
wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
|
wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
|
||||||
wxDefaultPosition,wxSize(300,200));
|
wxDefaultPosition,wxSize(300,200));
|
||||||
wxArrayString ar;
|
wxArrayString ar;
|
||||||
ar.Add(_T("*.cpp"));
|
ar.Add(_T("*.cpp"));
|
||||||
@@ -46,13 +46,12 @@ bool MyApp::OnInit()
|
|||||||
sizer->Add(lb, 1, wxEXPAND|wxALL, 10);
|
sizer->Add(lb, 1, wxEXPAND|wxALL, 10);
|
||||||
|
|
||||||
sizer->Add(5,5);
|
sizer->Add(5,5);
|
||||||
|
|
||||||
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
|
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
|
||||||
dlg.SetAutoLayout(true);
|
|
||||||
dlg.SetSizer(sizer);
|
dlg.SetSizer(sizer);
|
||||||
sizer->Fit(&dlg);
|
sizer->Fit(&dlg);
|
||||||
dlg.Centre();
|
dlg.Centre();
|
||||||
|
|
||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
|
|
||||||
wxString res = _("'Except' contains these strings:\n\n");
|
wxString res = _("'Except' contains these strings:\n\n");
|
||||||
@@ -60,6 +59,6 @@ bool MyApp::OnInit()
|
|||||||
for (size_t i = 0; i < ar.GetCount(); i++)
|
for (size_t i = 0; i < ar.GetCount(); i++)
|
||||||
res << ar[i] << _T("\n");
|
res << ar[i] << _T("\n");
|
||||||
wxMessageBox(res);
|
wxMessageBox(res);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
|
MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||||
// dtor
|
// dtor
|
||||||
~MMBoardFrame();
|
~MMBoardFrame();
|
||||||
|
|
||||||
// event handlers
|
// event handlers
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(wxCommandEvent& event);
|
||||||
@@ -86,28 +86,28 @@ public:
|
|||||||
void OnEject(wxCommandEvent& event);
|
void OnEject(wxCommandEvent& event);
|
||||||
void OnRefreshInfo(wxEvent& event);
|
void OnRefreshInfo(wxEvent& event);
|
||||||
void OnSetPosition(wxCommandEvent& event);
|
void OnSetPosition(wxCommandEvent& event);
|
||||||
|
|
||||||
void OpenVideoWindow();
|
void OpenVideoWindow();
|
||||||
void CloseVideoWindow();
|
void CloseVideoWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// any class wishing to process wxWidgets events must use this macro
|
// any class wishing to process wxWidgets events must use this macro
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateMMedInfo();
|
void UpdateMMedInfo();
|
||||||
void UpdateInfoText();
|
void UpdateInfoText();
|
||||||
|
|
||||||
MMBoardFile *m_opened_file;
|
MMBoardFile *m_opened_file;
|
||||||
|
|
||||||
wxSlider *m_positionSlider;
|
wxSlider *m_positionSlider;
|
||||||
wxBitmapButton *m_playButton, *m_pauseButton, *m_stopButton, *m_ejectButton;
|
wxBitmapButton *m_playButton, *m_pauseButton, *m_stopButton, *m_ejectButton;
|
||||||
wxStaticText *m_fileType, *m_infoText;
|
wxStaticText *m_fileType, *m_infoText;
|
||||||
wxWindow *m_video_window;
|
wxWindow *m_video_window;
|
||||||
|
|
||||||
wxPanel *m_panel;
|
wxPanel *m_panel;
|
||||||
wxSizer *m_sizer;
|
wxSizer *m_sizer;
|
||||||
|
|
||||||
wxTimer *m_refreshTimer;
|
wxTimer *m_refreshTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ BEGIN_EVENT_TABLE(MMBoardFrame, wxFrame)
|
|||||||
EVT_BUTTON(MMBoard_PlayButton, MMBoardFrame::OnPlay)
|
EVT_BUTTON(MMBoard_PlayButton, MMBoardFrame::OnPlay)
|
||||||
EVT_BUTTON(MMBoard_StopButton, MMBoardFrame::OnStop)
|
EVT_BUTTON(MMBoard_StopButton, MMBoardFrame::OnStop)
|
||||||
EVT_BUTTON(MMBoard_PauseButton, MMBoardFrame::OnPause)
|
EVT_BUTTON(MMBoard_PauseButton, MMBoardFrame::OnPause)
|
||||||
EVT_BUTTON(MMBoard_EjectButton, MMBoardFrame::OnEject)
|
EVT_BUTTON(MMBoard_EjectButton, MMBoardFrame::OnEject)
|
||||||
EVT_SLIDER(MMBoard_PositionSlider, MMBoardFrame::OnSetPosition)
|
EVT_SLIDER(MMBoard_PositionSlider, MMBoardFrame::OnSetPosition)
|
||||||
EVT_CUSTOM(wxEVT_TIMER, MMBoard_RefreshInfo, MMBoardFrame::OnRefreshInfo)
|
EVT_CUSTOM(wxEVT_TIMER, MMBoard_RefreshInfo, MMBoardFrame::OnRefreshInfo)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -169,43 +169,43 @@ bool MMBoardApp::OnInit()
|
|||||||
|
|
||||||
// and show it (the frames, unlike simple controls, are not shown when
|
// and show it (the frames, unlike simple controls, are not shown when
|
||||||
// created initially)
|
// created initially)
|
||||||
frame->Show(TRUE);
|
frame->Show();
|
||||||
|
|
||||||
m_caps = TestMultimediaCaps();
|
m_caps = TestMultimediaCaps();
|
||||||
|
|
||||||
if (!m_caps) {
|
if (!m_caps) {
|
||||||
wxMessageBox(_T("Your system has no multimedia capabilities. We are exiting now."), _T("Major error !"), wxOK | wxICON_ERROR, NULL);
|
wxMessageBox(_T("Your system has no multimedia capabilities. We are exiting now."), _T("Major error !"), wxOK | wxICON_ERROR, NULL);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf(_T("Detected : %s%s%s"), (m_caps & MM_SOUND_OSS) ? _T("OSS ") : _T(""),
|
msg.Printf(_T("Detected : %s%s%s"), (m_caps & MM_SOUND_OSS) ? _T("OSS ") : _T(""),
|
||||||
(m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""),
|
(m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""),
|
||||||
(m_caps & MM_SOUND_WIN) ? _T("WIN") : _T(""));
|
(m_caps & MM_SOUND_WIN) ? _T("WIN") : _T(""));
|
||||||
|
|
||||||
wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL);
|
wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL);
|
||||||
|
|
||||||
// success: wxApp::OnRun() will be called which will enter the main message
|
// success: wxApp::OnRun() will be called which will enter the main message
|
||||||
// loop and the application will run. If we returned FALSE here, the
|
// loop and the application will run. If we returned false here, the
|
||||||
// application would exit immediately.
|
// application would exit immediately.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxUint8 MMBoardApp::TestMultimediaCaps()
|
wxUint8 MMBoardApp::TestMultimediaCaps()
|
||||||
{
|
{
|
||||||
wxSoundStream *dev;
|
wxSoundStream *dev;
|
||||||
wxUint8 caps;
|
wxUint8 caps;
|
||||||
|
|
||||||
caps = 0;
|
caps = 0;
|
||||||
|
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
// We now test the ESD support
|
// We now test the ESD support
|
||||||
|
|
||||||
dev = new wxSoundStreamESD();
|
dev = new wxSoundStreamESD();
|
||||||
if (dev->GetError() == wxSOUND_NOERROR)
|
if (dev->GetError() == wxSOUND_NOERROR)
|
||||||
caps |= MM_SOUND_ESD;
|
caps |= MM_SOUND_ESD;
|
||||||
delete dev;
|
delete dev;
|
||||||
|
|
||||||
// We test the OSS (Open Sound System) support.
|
// We test the OSS (Open Sound System) support.
|
||||||
// WARNING: There is a conflict between ESD and ALSA. We may be interrested
|
// WARNING: There is a conflict between ESD and ALSA. We may be interrested
|
||||||
// in disabling the auto detection of OSS is ESD has been detected.
|
// in disabling the auto detection of OSS is ESD has been detected.
|
||||||
@@ -222,7 +222,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
// We test the Windows sound support.
|
// We test the Windows sound support.
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps()
|
|||||||
caps |= MM_SOUND_WIN;
|
caps |= MM_SOUND_WIN;
|
||||||
delete dev;
|
delete dev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps()
|
|||||||
|
|
||||||
// frame constructor
|
// frame constructor
|
||||||
MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// we need this in order to allow the about menu relocation, since ABOUT is
|
// we need this in order to allow the about menu relocation, since ABOUT is
|
||||||
@@ -253,7 +253,7 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
|
|||||||
SetIcon(wxICON(mondrian));
|
SetIcon(wxICON(mondrian));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF);
|
wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
|
||||||
|
|
||||||
// the "About" item should be in the help menu
|
// the "About" item should be in the help menu
|
||||||
wxMenu *helpMenu = new wxMenu;
|
wxMenu *helpMenu = new wxMenu;
|
||||||
@@ -280,68 +280,66 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
|
|||||||
// Misc variables
|
// Misc variables
|
||||||
m_opened_file = NULL;
|
m_opened_file = NULL;
|
||||||
|
|
||||||
m_panel = new wxPanel(this, -1);
|
m_panel = new wxPanel(this, wxID_ANY);
|
||||||
|
|
||||||
// Initialize main slider
|
// Initialize main slider
|
||||||
m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60,
|
m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60,
|
||||||
wxDefaultPosition, wxSize(300, -1),
|
wxDefaultPosition, wxSize(300, -1),
|
||||||
wxSL_HORIZONTAL | wxSL_AUTOTICKS);
|
wxSL_HORIZONTAL | wxSL_AUTOTICKS);
|
||||||
m_positionSlider->SetPageSize(60); // 60 secs
|
m_positionSlider->SetPageSize(60); // 60 secs
|
||||||
m_positionSlider->Enable(FALSE);
|
m_positionSlider->Disable();
|
||||||
|
|
||||||
// Initialize info panel
|
// Initialize info panel
|
||||||
wxPanel *infoPanel = new wxPanel( m_panel, -1);
|
wxPanel *infoPanel = new wxPanel( m_panel, wxID_ANY);
|
||||||
infoPanel->SetBackgroundColour(*wxBLACK);
|
infoPanel->SetBackgroundColour(*wxBLACK);
|
||||||
infoPanel->SetForegroundColour(*wxWHITE);
|
infoPanel->SetForegroundColour(*wxWHITE);
|
||||||
|
|
||||||
wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
m_fileType = new wxStaticText(infoPanel, -1, wxT(""));
|
m_fileType = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
|
||||||
wxStaticLine *line = new wxStaticLine(infoPanel, -1);
|
wxStaticLine *line = new wxStaticLine(infoPanel, wxID_ANY);
|
||||||
m_infoText = new wxStaticText(infoPanel, -1, _T(""));
|
m_infoText = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
|
||||||
|
|
||||||
UpdateInfoText();
|
UpdateInfoText();
|
||||||
|
|
||||||
infoSizer->Add(m_fileType, 0, wxGROW | wxALL, 1);
|
infoSizer->Add(m_fileType, 0, wxGROW | wxALL, 1);
|
||||||
infoSizer->Add(line, 0, wxGROW | wxCENTRE, 20);
|
infoSizer->Add(line, 0, wxGROW | wxCENTRE, 20);
|
||||||
infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1);
|
infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1);
|
||||||
|
|
||||||
infoPanel->SetSizer(infoSizer);
|
infoPanel->SetSizer(infoSizer);
|
||||||
infoPanel->SetAutoLayout(TRUE);
|
|
||||||
|
|
||||||
// Bitmap button panel
|
// Bitmap button panel
|
||||||
wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
wxBitmap play_bmp(play_back_xpm);
|
wxBitmap play_bmp(play_back_xpm);
|
||||||
wxBitmap stop_bmp(stop_back_xpm);
|
wxBitmap stop_bmp(stop_back_xpm);
|
||||||
wxBitmap eject_bmp(eject_xpm);
|
wxBitmap eject_bmp(eject_xpm);
|
||||||
wxBitmap pause_bmp(pause_xpm);
|
wxBitmap pause_bmp(pause_xpm);
|
||||||
|
|
||||||
m_playButton = new wxBitmapButton(m_panel, MMBoard_PlayButton, play_bmp);
|
m_playButton = new wxBitmapButton(m_panel, MMBoard_PlayButton, play_bmp);
|
||||||
m_playButton->Enable(FALSE);
|
m_playButton->Disable();
|
||||||
m_pauseButton = new wxBitmapButton(m_panel, MMBoard_PauseButton, pause_bmp);
|
m_pauseButton = new wxBitmapButton(m_panel, MMBoard_PauseButton, pause_bmp);
|
||||||
m_pauseButton->Enable(FALSE);
|
m_pauseButton->Disable();
|
||||||
m_stopButton = new wxBitmapButton(m_panel, MMBoard_StopButton, stop_bmp);
|
m_stopButton = new wxBitmapButton(m_panel, MMBoard_StopButton, stop_bmp);
|
||||||
m_stopButton->Enable(FALSE);
|
m_stopButton->Disable();
|
||||||
m_ejectButton = new wxBitmapButton(m_panel, MMBoard_EjectButton, eject_bmp);
|
m_ejectButton = new wxBitmapButton(m_panel, MMBoard_EjectButton, eject_bmp);
|
||||||
m_ejectButton->Enable(FALSE);
|
m_ejectButton->Disable();
|
||||||
|
|
||||||
buttonSizer->Add(m_playButton, 0, wxALL, 2);
|
buttonSizer->Add(m_playButton, 0, wxALL, 2);
|
||||||
buttonSizer->Add(m_pauseButton, 0, wxALL, 2);
|
buttonSizer->Add(m_pauseButton, 0, wxALL, 2);
|
||||||
buttonSizer->Add(m_stopButton, 0, wxALL, 2);
|
buttonSizer->Add(m_stopButton, 0, wxALL, 2);
|
||||||
buttonSizer->Add(m_ejectButton, 0, wxALL, 2);
|
buttonSizer->Add(m_ejectButton, 0, wxALL, 2);
|
||||||
|
|
||||||
// Top sizer
|
// Top sizer
|
||||||
m_sizer = new wxBoxSizer(wxVERTICAL);
|
m_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
|
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
|
||||||
m_sizer->Add(m_positionSlider, 0, wxCENTRE | wxGROW | wxALL, 2);
|
m_sizer->Add(m_positionSlider, 0, wxCENTRE | wxGROW | wxALL, 2);
|
||||||
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
|
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
|
||||||
m_sizer->Add(buttonSizer, 0, wxALL, 0);
|
m_sizer->Add(buttonSizer, 0, wxALL, 0);
|
||||||
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
|
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
|
||||||
m_sizer->Add(infoPanel, 1, wxCENTRE | wxGROW, 0);
|
m_sizer->Add(infoPanel, 1, wxCENTRE | wxGROW, 0);
|
||||||
|
|
||||||
m_panel->SetSizer(m_sizer);
|
m_panel->SetSizer(m_sizer);
|
||||||
m_panel->SetAutoLayout(TRUE);
|
|
||||||
m_sizer->Fit(this);
|
m_sizer->Fit(this);
|
||||||
m_sizer->SetSizeHints(this);
|
m_sizer->SetSizeHints(this);
|
||||||
|
|
||||||
@@ -359,7 +357,7 @@ MMBoardFrame::~MMBoardFrame()
|
|||||||
{
|
{
|
||||||
if (m_opened_file)
|
if (m_opened_file)
|
||||||
delete m_opened_file;
|
delete m_opened_file;
|
||||||
|
|
||||||
delete m_refreshTimer;
|
delete m_refreshTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +366,7 @@ void MMBoardFrame::OpenVideoWindow()
|
|||||||
if (m_video_window)
|
if (m_video_window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_video_window = new wxWindow(m_panel, -1, wxDefaultPosition, wxSize(200, 200));
|
m_video_window = new wxWindow(m_panel, wxID_ANY, wxDefaultPosition, wxSize(200, 200));
|
||||||
m_video_window->SetBackgroundColour(*wxBLACK);
|
m_video_window->SetBackgroundColour(*wxBLACK);
|
||||||
m_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1);
|
m_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1);
|
||||||
|
|
||||||
@@ -391,8 +389,8 @@ void MMBoardFrame::CloseVideoWindow()
|
|||||||
|
|
||||||
void MMBoardFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// TRUE is to force the frame to close
|
// true is to force the frame to close
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -400,15 +398,15 @@ void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( wxT("wxWidgets Multimedia board v1.0a, wxMMedia v2.0a:\n")
|
msg.Printf( wxT("wxWidgets Multimedia board v1.0a, wxMMedia v2.0a:\n")
|
||||||
wxT("an example of the capabilities of the wxWidgets multimedia classes.\n")
|
wxT("an example of the capabilities of the wxWidgets multimedia classes.\n")
|
||||||
wxT("Copyright 1999, 2000, Guilhem Lavaux.\n"));
|
wxT("Copyright 1999, 2000, Guilhem Lavaux.\n"));
|
||||||
|
|
||||||
wxMessageBox(msg, _T("About MMBoard"), wxOK | wxICON_INFORMATION, this);
|
wxMessageBox(msg, _T("About MMBoard"), wxOK | wxICON_INFORMATION, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxString selected_file;
|
wxString selected_file;
|
||||||
|
|
||||||
if (m_opened_file) {
|
if (m_opened_file) {
|
||||||
if (!m_opened_file->IsStopped()) {
|
if (!m_opened_file->IsStopped()) {
|
||||||
wxCommandEvent event2;
|
wxCommandEvent event2;
|
||||||
@@ -416,33 +414,33 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
delete m_opened_file;
|
delete m_opened_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
// select a file to be opened
|
// select a file to be opened
|
||||||
selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this);
|
selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this);
|
||||||
if (selected_file.IsNull())
|
if (selected_file.IsNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_opened_file = MMBoardManager::Open(selected_file);
|
m_opened_file = MMBoardManager::Open(selected_file);
|
||||||
|
|
||||||
// Change the range values of the slider.
|
// Change the range values of the slider.
|
||||||
MMBoardTime length;
|
MMBoardTime length;
|
||||||
|
|
||||||
length = m_opened_file->GetLength();
|
length = m_opened_file->GetLength();
|
||||||
m_positionSlider->SetRange(0, length.hours * 3600 + length.minutes * 60 + length.seconds);
|
m_positionSlider->SetRange(0, length.hours * 3600 + length.minutes * 60 + length.seconds);
|
||||||
|
|
||||||
// Update misc info
|
// Update misc info
|
||||||
UpdateMMedInfo();
|
UpdateMMedInfo();
|
||||||
|
|
||||||
SetStatusText(selected_file, 2);
|
SetStatusText(selected_file, 2);
|
||||||
|
|
||||||
// Update info text
|
// Update info text
|
||||||
UpdateInfoText();
|
UpdateInfoText();
|
||||||
|
|
||||||
// Enable a few buttons
|
// Enable a few buttons
|
||||||
m_playButton->Enable(TRUE);
|
m_playButton->Enable();
|
||||||
m_ejectButton->Enable(TRUE);
|
m_ejectButton->Enable();
|
||||||
m_positionSlider->Enable(TRUE);
|
m_positionSlider->Enable();
|
||||||
|
|
||||||
if (m_opened_file->NeedWindow()) {
|
if (m_opened_file->NeedWindow()) {
|
||||||
OpenVideoWindow();
|
OpenVideoWindow();
|
||||||
m_opened_file->SetWindow(m_video_window);
|
m_opened_file->SetWindow(m_video_window);
|
||||||
@@ -453,18 +451,18 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
|||||||
void MMBoardFrame::UpdateInfoText()
|
void MMBoardFrame::UpdateInfoText()
|
||||||
{
|
{
|
||||||
wxString infotext1, infotext2;
|
wxString infotext1, infotext2;
|
||||||
|
|
||||||
if (m_opened_file) {
|
if (m_opened_file) {
|
||||||
infotext1 = wxT("File type:\n\t");
|
infotext1 = wxT("File type:\n\t");
|
||||||
infotext1 += m_opened_file->GetStringType() + wxT("\n");
|
infotext1 += m_opened_file->GetStringType() + wxT("\n");
|
||||||
|
|
||||||
infotext2 = wxT("File informations:\n\n");
|
infotext2 = wxT("File informations:\n\n");
|
||||||
infotext2 += m_opened_file->GetStringInformation();
|
infotext2 += m_opened_file->GetStringInformation();
|
||||||
} else {
|
} else {
|
||||||
infotext1 = wxT("File type: \n\tNo file opened");
|
infotext1 = wxT("File type: \n\tNo file opened");
|
||||||
infotext2 = wxT("File informations:\nNo information\n\n\n\n\n");
|
infotext2 = wxT("File informations:\nNo information\n\n\n\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fileType->SetLabel(infotext1);
|
m_fileType->SetLabel(infotext1);
|
||||||
m_infoText->SetLabel(infotext2);
|
m_infoText->SetLabel(infotext2);
|
||||||
}
|
}
|
||||||
@@ -473,7 +471,7 @@ void MMBoardFrame::UpdateMMedInfo()
|
|||||||
{
|
{
|
||||||
wxString temp_string;
|
wxString temp_string;
|
||||||
MMBoardTime current, length;
|
MMBoardTime current, length;
|
||||||
|
|
||||||
if (m_opened_file) {
|
if (m_opened_file) {
|
||||||
current = m_opened_file->GetPosition();
|
current = m_opened_file->GetPosition();
|
||||||
length = m_opened_file->GetLength();
|
length = m_opened_file->GetLength();
|
||||||
@@ -486,7 +484,7 @@ void MMBoardFrame::UpdateMMedInfo()
|
|||||||
temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes,
|
temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes,
|
||||||
current.seconds, length.hours * 60 + length.minutes, length.seconds);
|
current.seconds, length.hours * 60 + length.minutes, length.seconds);
|
||||||
SetStatusText(temp_string, 1);
|
SetStatusText(temp_string, 1);
|
||||||
|
|
||||||
// We set the slider position
|
// We set the slider position
|
||||||
m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds);
|
m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds);
|
||||||
}
|
}
|
||||||
@@ -497,33 +495,35 @@ void MMBoardFrame::UpdateMMedInfo()
|
|||||||
void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
|
void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
UpdateMMedInfo();
|
UpdateMMedInfo();
|
||||||
|
|
||||||
if (m_opened_file->IsStopped()) {
|
if (m_opened_file->IsStopped())
|
||||||
|
{
|
||||||
m_refreshTimer->Stop();
|
m_refreshTimer->Stop();
|
||||||
m_playButton->Enable(TRUE);
|
m_playButton->Enable();
|
||||||
m_stopButton->Enable(FALSE);
|
m_stopButton->Disable();
|
||||||
m_pauseButton->Enable(FALSE);
|
m_pauseButton->Disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_stopButton->Enable(TRUE);
|
m_stopButton->Enable();
|
||||||
m_pauseButton->Enable(TRUE);
|
m_pauseButton->Enable();
|
||||||
m_playButton->Enable(FALSE);
|
m_playButton->Disable();
|
||||||
|
|
||||||
if (m_opened_file->IsPaused()) {
|
if (m_opened_file->IsPaused())
|
||||||
|
{
|
||||||
m_opened_file->Resume();
|
m_opened_file->Resume();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_refreshTimer->Start(1000, FALSE);
|
m_refreshTimer->Start(1000, false);
|
||||||
|
|
||||||
m_opened_file->Play();
|
m_opened_file->Play();
|
||||||
|
|
||||||
m_stopButton->Enable(TRUE);
|
m_stopButton->Enable();
|
||||||
m_pauseButton->Enable(TRUE);
|
m_pauseButton->Enable();
|
||||||
m_playButton->Enable(FALSE);
|
m_playButton->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -531,18 +531,18 @@ void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
|
|||||||
m_opened_file->Stop();
|
m_opened_file->Stop();
|
||||||
m_refreshTimer->Stop();
|
m_refreshTimer->Stop();
|
||||||
|
|
||||||
m_stopButton->Enable(FALSE);
|
m_stopButton->Disable();
|
||||||
m_playButton->Enable(TRUE);
|
m_playButton->Enable();
|
||||||
|
|
||||||
UpdateMMedInfo();
|
UpdateMMedInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_opened_file->Pause();
|
m_opened_file->Pause();
|
||||||
|
|
||||||
m_playButton->Enable(TRUE);
|
m_playButton->Enable();
|
||||||
m_pauseButton->Enable(FALSE);
|
m_pauseButton->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
|
void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -551,12 +551,12 @@ void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
delete m_opened_file;
|
delete m_opened_file;
|
||||||
m_opened_file = NULL;
|
m_opened_file = NULL;
|
||||||
|
|
||||||
m_playButton->Enable(FALSE);
|
m_playButton->Disable();
|
||||||
m_pauseButton->Enable(FALSE);
|
m_pauseButton->Disable();
|
||||||
m_stopButton->Enable(FALSE);
|
m_stopButton->Disable();
|
||||||
m_ejectButton->Enable(FALSE);
|
m_ejectButton->Disable();
|
||||||
m_positionSlider->Enable(FALSE);
|
m_positionSlider->Disable();
|
||||||
|
|
||||||
UpdateInfoText();
|
UpdateInfoText();
|
||||||
UpdateMMedInfo();
|
UpdateMMedInfo();
|
||||||
@@ -566,7 +566,7 @@ void MMBoardFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
wxUint32 itime;
|
wxUint32 itime;
|
||||||
MMBoardTime btime;
|
MMBoardTime btime;
|
||||||
|
|
||||||
itime = m_positionSlider->GetValue();
|
itime = m_positionSlider->GetValue();
|
||||||
btime.seconds = itime % 60;
|
btime.seconds = itime % 60;
|
||||||
btime.minutes = (itime / 60) % 60;
|
btime.minutes = (itime / 60) % 60;
|
||||||
|
@@ -218,7 +218,7 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (!m_propertySheet)
|
if (!m_propertySheet)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (win.GetName() == wxT(""))
|
if (win.GetName().empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
|
if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
|
||||||
|
@@ -156,7 +156,7 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea)
|
|||||||
if (clearEditArea)
|
if (clearEditArea)
|
||||||
{
|
{
|
||||||
m_valueList->Clear();
|
m_valueList->Clear();
|
||||||
m_valueText->SetValue( wxT("") );
|
m_valueText->SetValue(wxEmptyString);
|
||||||
}
|
}
|
||||||
wxNode *node = m_propertySheet->GetProperties().GetFirst();
|
wxNode *node = m_propertySheet->GetProperties().GetFirst();
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ bool wxPropertyListView::ShowProperty(wxProperty *property, bool select)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_valueList->Clear();
|
m_valueList->Clear();
|
||||||
m_valueText->SetValue( wxT("") );
|
m_valueText->SetValue(wxEmptyString);
|
||||||
|
|
||||||
if (property)
|
if (property)
|
||||||
{
|
{
|
||||||
@@ -464,15 +464,15 @@ bool wxPropertyListView::CreateControls()
|
|||||||
topsizer->Add( m_cancelButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
|
topsizer->Add( m_cancelButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, _T(""),
|
m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString,
|
||||||
wxDefaultPosition, wxSize(wxDefaultSize.x, smallButtonSize.y), wxPROCESS_ENTER);
|
wxDefaultPosition, wxSize(wxDefaultSize.x, smallButtonSize.y), wxPROCESS_ENTER);
|
||||||
m_valueText->Enable(false);
|
m_valueText->Disable();
|
||||||
topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
|
topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
|
||||||
|
|
||||||
if (m_buttonFlags & wxPROP_PULLDOWN)
|
if (m_buttonFlags & wxPROP_PULLDOWN)
|
||||||
{
|
{
|
||||||
m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxDefaultPosition, smallButtonSize);
|
m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxDefaultPosition, smallButtonSize);
|
||||||
m_editButton->Enable(false);
|
m_editButton->Disable();
|
||||||
topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
|
topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ bool wxPropertyListValidator::OnSelect(bool select, wxProperty *property, wxProp
|
|||||||
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
wxString s(view->GetValueList()->GetStringSelection());
|
wxString s(view->GetValueList()->GetStringSelection());
|
||||||
if (s != wxT(""))
|
if ( !s.empty() )
|
||||||
{
|
{
|
||||||
view->GetValueText()->SetValue(s);
|
view->GetValueText()->SetValue(s);
|
||||||
view->RetrieveProperty(property);
|
view->RetrieveProperty(property);
|
||||||
@@ -864,11 +864,11 @@ void wxPropertyListValidator::OnEdit(wxProperty *WXUNUSED(property), wxPropertyL
|
|||||||
bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(false);
|
view->GetConfirmButton()->Disable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(false);
|
view->GetCancelButton()->Disable();
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(false);
|
view->GetEditButton()->Disable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -929,13 +929,13 @@ bool wxRealListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
|
|||||||
bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(true);
|
view->GetConfirmButton()->Enable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(true);
|
view->GetCancelButton()->Enable();
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(false);
|
view->GetEditButton()->Disable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(true);
|
view->GetValueText()->Enable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,13 +991,13 @@ bool wxIntegerListValidator::OnRetrieveValue(wxProperty *property, wxPropertyLis
|
|||||||
bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(true);
|
view->GetConfirmButton()->Enable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(true);
|
view->GetCancelButton()->Enable();
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(false);
|
view->GetEditButton()->Disable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(true);
|
view->GetValueText()->Enable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1054,13 +1054,13 @@ bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListVie
|
|||||||
bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(false);
|
view->GetConfirmButton()->Disable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(false);
|
view->GetCancelButton()->Disable();
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(true);
|
view->GetEditButton()->Enable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(false);
|
view->GetValueText()->Disable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1069,7 +1069,7 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property)
|
|||||||
if (view->GetValueList())
|
if (view->GetValueList())
|
||||||
{
|
{
|
||||||
view->ShowListBoxControl(true);
|
view->ShowListBoxControl(true);
|
||||||
view->GetValueList()->Enable(true);
|
view->GetValueList()->Enable();
|
||||||
|
|
||||||
view->GetValueList()->Append(wxT("True"));
|
view->GetValueList()->Append(wxT("True"));
|
||||||
view->GetValueList()->Append(wxT("False"));
|
view->GetValueList()->Append(wxT("False"));
|
||||||
@@ -1086,7 +1086,7 @@ bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property),
|
|||||||
{
|
{
|
||||||
view->GetValueList()->Clear();
|
view->GetValueList()->Clear();
|
||||||
view->ShowListBoxControl(false);
|
view->ShowListBoxControl(false);
|
||||||
view->GetValueList()->Enable(false);
|
view->GetValueList()->Disable();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1175,27 +1175,27 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx
|
|||||||
if (!m_strings)
|
if (!m_strings)
|
||||||
{
|
{
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(false);
|
view->GetEditButton()->Disable();
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(true);
|
view->GetConfirmButton()->Enable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(true);
|
view->GetCancelButton()->Enable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(true);
|
view->GetValueText()->Enable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constrained
|
// Constrained
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(false);
|
view->GetValueText()->Disable();
|
||||||
|
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(true);
|
view->GetEditButton()->Enable();
|
||||||
|
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(false);
|
view->GetConfirmButton()->Disable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(false);
|
view->GetCancelButton()->Disable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1206,7 +1206,7 @@ bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property,
|
|||||||
if (view->GetValueList())
|
if (view->GetValueList())
|
||||||
{
|
{
|
||||||
view->ShowListBoxControl(true);
|
view->ShowListBoxControl(true);
|
||||||
view->GetValueList()->Enable(true);
|
view->GetValueList()->Enable();
|
||||||
wxStringList::Node *node = m_strings->GetFirst();
|
wxStringList::Node *node = m_strings->GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -1231,7 +1231,7 @@ bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property)
|
|||||||
{
|
{
|
||||||
view->GetValueList()->Clear();
|
view->GetValueList()->Clear();
|
||||||
view->ShowListBoxControl(false);
|
view->ShowListBoxControl(false);
|
||||||
view->GetValueList()->Enable(false);
|
view->GetValueList()->Disable();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1326,11 +1326,11 @@ bool wxFilenameListValidator::OnDoubleClick(wxProperty *property, wxPropertyList
|
|||||||
bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(true);
|
view->GetConfirmButton()->Enable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(true);
|
view->GetCancelButton()->Enable();
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(true);
|
view->GetEditButton()->Enable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
|
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
|
||||||
return true;
|
return true;
|
||||||
@@ -1349,7 +1349,7 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v
|
|||||||
m_filenameWildCard.GetData(),
|
m_filenameWildCard.GetData(),
|
||||||
0,
|
0,
|
||||||
parentWindow);
|
parentWindow);
|
||||||
if (s != wxT(""))
|
if ( !s.empty() )
|
||||||
{
|
{
|
||||||
property->GetValue() = s;
|
property->GetValue() = s;
|
||||||
view->DisplayProperty(property);
|
view->DisplayProperty(property);
|
||||||
@@ -1414,15 +1414,19 @@ bool wxColourListValidator::OnDoubleClick(wxProperty *property, wxPropertyListVi
|
|||||||
|
|
||||||
bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(true);
|
view->GetConfirmButton()->Enable();
|
||||||
if (view->GetCancelButton())
|
|
||||||
view->GetCancelButton()->Enable(true);
|
if (view->GetCancelButton())
|
||||||
if (view->GetEditButton())
|
view->GetCancelButton()->Enable();
|
||||||
view->GetEditButton()->Enable(true);
|
|
||||||
if (view->GetValueText())
|
if (view->GetEditButton())
|
||||||
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
|
view->GetEditButton()->Enable();
|
||||||
return true;
|
|
||||||
|
if (view->GetValueText())
|
||||||
|
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow)
|
void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow)
|
||||||
@@ -1509,14 +1513,14 @@ bool wxListOfStringsListValidator::OnDisplayValue(wxProperty *property, wxProper
|
|||||||
bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
|
||||||
{
|
{
|
||||||
if (view->GetEditButton())
|
if (view->GetEditButton())
|
||||||
view->GetEditButton()->Enable(true);
|
view->GetEditButton()->Enable();
|
||||||
if (view->GetValueText())
|
if (view->GetValueText())
|
||||||
view->GetValueText()->Enable(false);
|
view->GetValueText()->Disable();
|
||||||
|
|
||||||
if (view->GetConfirmButton())
|
if (view->GetConfirmButton())
|
||||||
view->GetConfirmButton()->Enable(false);
|
view->GetConfirmButton()->Disable();
|
||||||
if (view->GetCancelButton())
|
if (view->GetCancelButton())
|
||||||
view->GetCancelButton()->Enable(false);
|
view->GetCancelButton()->Disable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1651,9 +1655,9 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
|
|||||||
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE);
|
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE);
|
||||||
|
|
||||||
dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
|
dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
|
||||||
wxID_PROP_SL_TEXT, wxT(""), wxPoint(5, 240),
|
wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240),
|
||||||
wxSize(300, wxDefaultSize.y), wxPROCESS_ENTER);
|
wxSize(300, wxDefaultSize.y), wxPROCESS_ENTER);
|
||||||
dialog->m_stringText->Enable(false);
|
dialog->m_stringText->Disable();
|
||||||
|
|
||||||
wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
|
wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
|
||||||
wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
|
wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
|
||||||
@@ -1665,15 +1669,15 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxBoxSizer *m_bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
|
wxBoxSizer *m_bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 );
|
m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 );
|
||||||
m_bottom_sizer->Add(deleteButton, 0, wxALL | wxALIGN_LEFT, 2 );
|
m_bottom_sizer->Add(deleteButton, 0, wxALL | wxALIGN_LEFT, 2 );
|
||||||
m_bottom_sizer->Add(1, 1, 1, wxEXPAND | wxALL);
|
m_bottom_sizer->Add(1, 1, 1, wxEXPAND | wxALL);
|
||||||
m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 );
|
m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 );
|
||||||
m_bottom_sizer->Add(okButton, 0, wxALL | wxALIGN_RIGHT, 2 );
|
m_bottom_sizer->Add(okButton, 0, wxALL | wxALIGN_RIGHT, 2 );
|
||||||
|
|
||||||
wxBoxSizer *m_sizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *m_sizer = new wxBoxSizer( wxVERTICAL );
|
||||||
m_sizer->Add(dialog->m_listBox, 1, wxEXPAND | wxALL, 2 );
|
m_sizer->Add(dialog->m_listBox, 1, wxEXPAND | wxALL, 2 );
|
||||||
m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 );
|
m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 );
|
||||||
m_sizer->Add(m_bottom_sizer, 0, wxEXPAND | wxALL , 0 );
|
m_sizer->Add(m_bottom_sizer, 0, wxEXPAND | wxALL , 0 );
|
||||||
|
|
||||||
dialog->SetSizer( m_sizer );
|
dialog->SetSizer( m_sizer );
|
||||||
@@ -1729,7 +1733,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
|
|||||||
delete[] (wxChar *)node->GetData();
|
delete[] (wxChar *)node->GetData();
|
||||||
delete node;
|
delete node;
|
||||||
m_currentSelection = -1;
|
m_currentSelection = -1;
|
||||||
m_stringText->SetValue(_T(""));
|
m_stringText->SetValue(wxEmptyString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
|
void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -1798,13 +1802,13 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection()
|
|||||||
{
|
{
|
||||||
if (m_currentSelection == -1)
|
if (m_currentSelection == -1)
|
||||||
{
|
{
|
||||||
m_stringText->SetValue(wxT(""));
|
m_stringText->SetValue(wxEmptyString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
|
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
|
||||||
wxChar *txt = (wxChar *)node->GetData();
|
wxChar *txt = (wxChar *)node->GetData();
|
||||||
m_stringText->SetValue(txt);
|
m_stringText->SetValue(txt);
|
||||||
m_stringText->Enable(true);
|
m_stringText->Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -115,7 +115,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
|
|||||||
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name)
|
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name)
|
||||||
{
|
{
|
||||||
m_style = style;
|
m_style = style;
|
||||||
m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL;
|
m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL;
|
||||||
|
|
||||||
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
@@ -165,7 +165,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
|
|||||||
m_bDown->SetToolTip(_("Move down"));
|
m_bDown->SetToolTip(_("Move down"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
subp->SetAutoLayout(true);
|
|
||||||
subp->SetSizer(subsizer);
|
subp->SetSizer(subsizer);
|
||||||
subsizer->Fit(subp);
|
subsizer->Fit(subp);
|
||||||
|
|
||||||
@@ -181,7 +180,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
sizer->Add(m_listCtrl, 1, wxEXPAND);
|
sizer->Add(m_listCtrl, 1, wxEXPAND);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
@@ -194,7 +192,7 @@ void wxEditableListBox::SetStrings(const wxArrayString& strings)
|
|||||||
for (i = 0; i < strings.GetCount(); i++)
|
for (i = 0; i < strings.GetCount(); i++)
|
||||||
m_listCtrl->InsertItem(i, strings[i]);
|
m_listCtrl->InsertItem(i, strings[i]);
|
||||||
|
|
||||||
m_listCtrl->InsertItem(strings.GetCount(), _T(""));
|
m_listCtrl->InsertItem(strings.GetCount(), wxEmptyString);
|
||||||
m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,13 +224,13 @@ void wxEditableListBox::OnNewItem(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
|
void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
|
||||||
{
|
{
|
||||||
if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
|
if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
|
||||||
!event.GetText().IsEmpty() )
|
!event.GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
// The user edited last (empty) line, i.e. added new entry. We have to
|
// The user edited last (empty) line, i.e. added new entry. We have to
|
||||||
// add new empty line here so that adding one more line is still
|
// add new empty line here so that adding one more line is still
|
||||||
// possible:
|
// possible:
|
||||||
m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T(""));
|
m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
|
|||||||
|
|
||||||
if (m_parentSizer == NULL) // setup window:
|
if (m_parentSizer == NULL) // setup window:
|
||||||
{
|
{
|
||||||
m_parentAsWindow->SetAutoLayout(true);
|
|
||||||
m_parentAsWindow->SetSizer(sizer);
|
m_parentAsWindow->SetSizer(sizer);
|
||||||
|
|
||||||
wxXmlNode *nd = m_node;
|
wxXmlNode *nd = m_node;
|
||||||
|
@@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child)
|
|||||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
SetAutoLayout(true);
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -255,7 +255,6 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
|
|||||||
m_TreeCtrl->AssignImageList(imgList);
|
m_TreeCtrl->AssignImageList(imgList);
|
||||||
sizer->Add(m_TreeCtrl, 1, wxEXPAND);
|
sizer->Add(m_TreeCtrl, 1, wxEXPAND);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
|
|
||||||
// Load file:
|
// Load file:
|
||||||
@@ -533,7 +532,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
|
|||||||
case ID_OPEN :
|
case ID_OPEN :
|
||||||
{
|
{
|
||||||
wxString cwd = wxGetCwd(); // workaround for 2.2
|
wxString cwd = wxGetCwd(); // workaround for 2.2
|
||||||
wxString name = wxFileSelector(_("Open XML resource"), _T(""), _T(""), _T(""), _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST);
|
wxString name = wxFileSelector(_("Open XML resource"), wxEmptyString, wxEmptyString, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST);
|
||||||
wxSetWorkingDirectory(cwd);
|
wxSetWorkingDirectory(cwd);
|
||||||
if (!name.IsEmpty())
|
if (!name.IsEmpty())
|
||||||
LoadFile(name);
|
LoadFile(name);
|
||||||
@@ -547,7 +546,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
|
|||||||
case ID_SAVEAS :
|
case ID_SAVEAS :
|
||||||
{
|
{
|
||||||
wxString cwd = wxGetCwd(); // workaround for 2.2
|
wxString cwd = wxGetCwd(); // workaround for 2.2
|
||||||
wxString name = wxFileSelector(_("Save as"), _T(""), m_FileName, _T(""), _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT);
|
wxString name = wxFileSelector(_("Save as"), wxEmptyString, m_FileName, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT);
|
||||||
wxSetWorkingDirectory(cwd);
|
wxSetWorkingDirectory(cwd);
|
||||||
if (!name.IsEmpty())
|
if (!name.IsEmpty())
|
||||||
SaveFile((m_FileName = name));
|
SaveFile((m_FileName = name));
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
wxWindow* PropEditCtrlFont::CreateEditCtrl()
|
wxWindow* PropEditCtrlFont::CreateEditCtrl()
|
||||||
{
|
{
|
||||||
PropEditCtrlTxt::CreateEditCtrl();
|
PropEditCtrlTxt::CreateEditCtrl();
|
||||||
m_TextCtrl->Enable(false);
|
m_TextCtrl->Disable();
|
||||||
return m_TextCtrl;
|
return m_TextCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +165,6 @@ void PropEditCtrlFlags::OnDetails()
|
|||||||
sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
|
sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
|
||||||
|
|
||||||
dlg.SetSizer(sz);
|
dlg.SetSizer(sz);
|
||||||
dlg.SetAutoLayout(true);
|
|
||||||
dlg.Layout();
|
dlg.Layout();
|
||||||
|
|
||||||
for (i = 0; i < arr.GetCount(); i++)
|
for (i = 0; i < arr.GetCount(); i++)
|
||||||
@@ -219,7 +218,7 @@ void PropEditCtrlFile::OnDetails()
|
|||||||
wxString name = wxFileSelector(_("Choose file"),
|
wxString name = wxFileSelector(_("Choose file"),
|
||||||
wxPathOnly(txt),
|
wxPathOnly(txt),
|
||||||
wxFileNameFromPath(txt),
|
wxFileNameFromPath(txt),
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
GetFileTypes(),
|
GetFileTypes(),
|
||||||
wxOPEN | wxFILE_MUST_EXIST);
|
wxOPEN | wxFILE_MUST_EXIST);
|
||||||
if (!name) return;
|
if (!name) return;
|
||||||
|
@@ -66,7 +66,6 @@ void PropEditCtrl::BeginEdit(const wxRect& rect, wxTreeItemId ti)
|
|||||||
if (HasClearButton())
|
if (HasClearButton())
|
||||||
sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition,
|
sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition,
|
||||||
wxSize(16,wxDefaultSize.y)));
|
wxSize(16,wxDefaultSize.y)));
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sz);
|
SetSizer(sz);
|
||||||
m_Created = true;
|
m_Created = true;
|
||||||
}
|
}
|
||||||
|
@@ -37,17 +37,17 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
wxDialog(parent, ID_DIALOG_DSN, title)
|
wxDialog(parent, ID_DIALOG_DSN, title)
|
||||||
{
|
{
|
||||||
int chSize; // Height of Font * 1.4 = Height of wxTextCtrl
|
int chSize; // Height of Font * 1.4 = Height of wxTextCtrl
|
||||||
|
|
||||||
float ratio = (float)1.4;
|
float ratio = (float)1.4;
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
ratio = (float)2.1;
|
ratio = (float)2.1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetBackgroundColour(_T("wheat"));
|
SetBackgroundColour(_T("wheat"));
|
||||||
pDoc = p_Doc;
|
pDoc = p_Doc;
|
||||||
wxLayoutConstraints* layout;
|
wxLayoutConstraints* layout;
|
||||||
SetAutoLayout(true);
|
SetAutoLayout(true);
|
||||||
|
|
||||||
m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:"));
|
m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:"));
|
||||||
m_Label1->SetFont(* pDoc->ft_Doc);
|
m_Label1->SetFont(* pDoc->ft_Doc);
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
@@ -56,14 +56,14 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.AsIs();
|
layout->height.AsIs();
|
||||||
layout->width.Absolute(75);
|
layout->width.Absolute(75);
|
||||||
m_Label1->SetConstraints(layout);
|
m_Label1->SetConstraints(layout);
|
||||||
|
|
||||||
int w;
|
int w;
|
||||||
m_Label1->GetSize(&w, &chSize);
|
m_Label1->GetSize(&w, &chSize);
|
||||||
|
|
||||||
m_UserName = new wxTextCtrl(this, wxID_ANY, _T(""));
|
m_UserName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
|
||||||
m_UserName->SetFont(* pDoc->ft_Doc);
|
m_UserName->SetFont(* pDoc->ft_Doc);
|
||||||
chSize = (int) (m_UserName->GetCharHeight()*ratio);
|
chSize = (int) (m_UserName->GetCharHeight()*ratio);
|
||||||
|
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
layout->left.SameAs(m_Label1, wxRight, 10);
|
layout->left.SameAs(m_Label1, wxRight, 10);
|
||||||
layout->centreY.SameAs(m_Label1,wxCentreY);
|
layout->centreY.SameAs(m_Label1,wxCentreY);
|
||||||
@@ -71,8 +71,8 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.Absolute(chSize);
|
layout->height.Absolute(chSize);
|
||||||
// layout->height.AsIs();
|
// layout->height.AsIs();
|
||||||
m_UserName->SetConstraints(layout);
|
m_UserName->SetConstraints(layout);
|
||||||
|
|
||||||
|
|
||||||
m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:"));
|
m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:"));
|
||||||
m_Label2->SetFont(* pDoc->ft_Doc);
|
m_Label2->SetFont(* pDoc->ft_Doc);
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
@@ -81,8 +81,8 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.AsIs();
|
layout->height.AsIs();
|
||||||
layout->width.SameAs(m_Label1, wxWidth);
|
layout->width.SameAs(m_Label1, wxWidth);
|
||||||
m_Label2->SetConstraints(layout);
|
m_Label2->SetConstraints(layout);
|
||||||
|
|
||||||
m_Password = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
|
m_Password = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
|
||||||
m_Password->SetFont(* pDoc->ft_Doc);
|
m_Password->SetFont(* pDoc->ft_Doc);
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
layout->left.SameAs(m_UserName, wxLeft);
|
layout->left.SameAs(m_UserName, wxLeft);
|
||||||
@@ -91,7 +91,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.Absolute(chSize);
|
layout->height.Absolute(chSize);
|
||||||
//layout->height.AsIs();
|
//layout->height.AsIs();
|
||||||
m_Password->SetConstraints(layout);
|
m_Password->SetConstraints(layout);
|
||||||
|
|
||||||
m_OK = new wxButton(this, wxID_OK, _("OK"));
|
m_OK = new wxButton(this, wxID_OK, _("OK"));
|
||||||
m_OK->SetFont(* pDoc->ft_Doc);
|
m_OK->SetFont(* pDoc->ft_Doc);
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
@@ -100,7 +100,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.AsIs();
|
layout->height.AsIs();
|
||||||
layout->width.Absolute(75);
|
layout->width.Absolute(75);
|
||||||
m_OK->SetConstraints(layout);
|
m_OK->SetConstraints(layout);
|
||||||
|
|
||||||
m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||||
m_Cancel->SetFont(* pDoc->ft_Doc);
|
m_Cancel->SetFont(* pDoc->ft_Doc);
|
||||||
layout = new wxLayoutConstraints;
|
layout = new wxLayoutConstraints;
|
||||||
@@ -109,12 +109,12 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
|
|||||||
layout->height.AsIs();
|
layout->height.AsIs();
|
||||||
layout->width.SameAs(m_OK, wxWidth);
|
layout->width.SameAs(m_OK, wxWidth);
|
||||||
m_Cancel->SetConstraints(layout);
|
m_Cancel->SetConstraints(layout);
|
||||||
|
|
||||||
m_OK->SetDefault();
|
m_OK->SetDefault();
|
||||||
m_UserName->SetFocus();
|
m_UserName->SetFocus();
|
||||||
|
|
||||||
s_User = _T("");
|
s_User = wxEmptyString;
|
||||||
s_Password = _T("");
|
s_Password = wxEmptyString;
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ public:
|
|||||||
// open/close
|
// open/close
|
||||||
// create a new file (with the default value of bOverwrite, it will fail if
|
// create a new file (with the default value of bOverwrite, it will fail if
|
||||||
// the file already exists, otherwise it will overwrite it and succeed)
|
// the file already exists, otherwise it will overwrite it and succeed)
|
||||||
bool Create(const wxChar *szFileName, bool bOverwrite = FALSE,
|
bool Create(const wxChar *szFileName, bool bOverwrite = false,
|
||||||
int access = wxS_DEFAULT);
|
int access = wxS_DEFAULT);
|
||||||
bool Open(const wxChar *szFileName, OpenMode mode = read,
|
bool Open(const wxChar *szFileName, OpenMode mode = read,
|
||||||
int access = wxS_DEFAULT);
|
int access = wxS_DEFAULT);
|
||||||
|
@@ -33,11 +33,11 @@ public:
|
|||||||
// start enumerating font facenames (either all of them or those which
|
// start enumerating font facenames (either all of them or those which
|
||||||
// support the given encoding) - will result in OnFacename() being
|
// support the given encoding) - will result in OnFacename() being
|
||||||
// called for each available facename (until they are exhausted or
|
// called for each available facename (until they are exhausted or
|
||||||
// OnFacename returns FALSE)
|
// OnFacename returns false)
|
||||||
virtual bool EnumerateFacenames
|
virtual bool EnumerateFacenames
|
||||||
(
|
(
|
||||||
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
|
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
|
||||||
bool fixedWidthOnly = FALSE
|
bool fixedWidthOnly = false
|
||||||
);
|
);
|
||||||
|
|
||||||
// enumerate the different encodings either for given font facename or for
|
// enumerate the different encodings either for given font facename or for
|
||||||
@@ -46,43 +46,43 @@ public:
|
|||||||
virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString);
|
virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString);
|
||||||
|
|
||||||
// callbacks which are called after one of EnumerateXXX() functions from
|
// callbacks which are called after one of EnumerateXXX() functions from
|
||||||
// above is invoked - all of them may return FALSE to stop enumeration or
|
// above is invoked - all of them may return false to stop enumeration or
|
||||||
// TRUE to continue with it
|
// true to continue with it
|
||||||
|
|
||||||
// called by EnumerateFacenames
|
// called by EnumerateFacenames
|
||||||
virtual bool OnFacename(const wxString& facename)
|
virtual bool OnFacename(const wxString& facename)
|
||||||
{
|
{
|
||||||
if (m_Facenames == NULL) m_Facenames = new wxArrayString;
|
if (m_Facenames == NULL) m_Facenames = new wxArrayString;
|
||||||
m_Facenames -> Add(facename);
|
m_Facenames -> Add(facename);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// called by EnumerateEncodings
|
// called by EnumerateEncodings
|
||||||
virtual bool OnFontEncoding(const wxString& WXUNUSED(facename),
|
virtual bool OnFontEncoding(const wxString& WXUNUSED(facename),
|
||||||
const wxString& encoding)
|
const wxString& encoding)
|
||||||
{
|
{
|
||||||
if (m_Encodings == NULL) m_Encodings = new wxArrayString;
|
if (m_Encodings == NULL) m_Encodings = new wxArrayString;
|
||||||
m_Encodings -> Add(encoding);
|
m_Encodings -> Add(encoding);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convenience function that returns array of facenames. Cannot be called
|
// convenience function that returns array of facenames. Cannot be called
|
||||||
// before EnumerateFacenames.
|
// before EnumerateFacenames.
|
||||||
wxArrayString *GetFacenames()
|
wxArrayString *GetFacenames()
|
||||||
{ return m_Facenames; }
|
{ return m_Facenames; }
|
||||||
|
|
||||||
// convenience function that returns array of encodings.
|
// convenience function that returns array of encodings.
|
||||||
// Cannot be called before EnumerateEncodings.
|
// Cannot be called before EnumerateEncodings.
|
||||||
wxArrayString *GetEncodings()
|
wxArrayString *GetEncodings()
|
||||||
{ return m_Encodings; }
|
{ return m_Encodings; }
|
||||||
|
|
||||||
// virtual dtor for the base class
|
// virtual dtor for the base class
|
||||||
virtual ~wxFontEnumerator()
|
virtual ~wxFontEnumerator()
|
||||||
{
|
{
|
||||||
if (m_Facenames) delete m_Facenames;
|
if (m_Facenames) delete m_Facenames;
|
||||||
if (m_Encodings) delete m_Encodings;
|
if (m_Encodings) delete m_Encodings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxArrayString *m_Facenames, *m_Encodings;
|
wxArrayString *m_Facenames, *m_Encodings;
|
||||||
|
|
||||||
|
@@ -90,14 +90,14 @@ class WXDLLEXPORT wxLogWindow : public wxLogPassThrough
|
|||||||
public:
|
public:
|
||||||
wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL)
|
wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL)
|
||||||
const wxChar *szTitle, // the title of the frame
|
const wxChar *szTitle, // the title of the frame
|
||||||
bool bShow = TRUE, // show window immediately?
|
bool bShow = true, // show window immediately?
|
||||||
bool bPassToOld = TRUE); // pass messages to the old target?
|
bool bPassToOld = true); // pass messages to the old target?
|
||||||
|
|
||||||
~wxLogWindow();
|
~wxLogWindow();
|
||||||
|
|
||||||
// window operations
|
// window operations
|
||||||
// show/hide the log window
|
// show/hide the log window
|
||||||
void Show(bool bShow = TRUE);
|
void Show(bool bShow = true);
|
||||||
// retrieve the pointer to the frame
|
// retrieve the pointer to the frame
|
||||||
wxFrame *GetFrame() const;
|
wxFrame *GetFrame() const;
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
virtual void OnFrameCreate(wxFrame *frame);
|
virtual void OnFrameCreate(wxFrame *frame);
|
||||||
// called if the user closes the window interactively, will not be
|
// called if the user closes the window interactively, will not be
|
||||||
// called if it is destroyed for another reason (such as when program
|
// called if it is destroyed for another reason (such as when program
|
||||||
// exits) - return TRUE from here to allow the frame to close, FALSE
|
// exits) - return true from here to allow the frame to close, false
|
||||||
// to prevent this from happening
|
// to prevent this from happening
|
||||||
virtual bool OnFrameClose(wxFrame *frame);
|
virtual bool OnFrameClose(wxFrame *frame);
|
||||||
// called right before the log frame is going to be deleted: will
|
// called right before the log frame is going to be deleted: will
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
@param newmsg if used, new message to display
|
@param newmsg if used, new message to display
|
||||||
@returns true if ABORT button has not been pressed
|
@returns true if ABORT button has not been pressed
|
||||||
*/
|
*/
|
||||||
virtual bool Update(int value, const wxString& newmsg = wxT(""));
|
virtual bool Update(int value, const wxString& newmsg = wxEmptyString);
|
||||||
|
|
||||||
/* Can be called to continue after the cancel button has been pressed, but
|
/* Can be called to continue after the cancel button has been pressed, but
|
||||||
the program decided to continue the operation (e.g., user didn't
|
the program decided to continue the operation (e.g., user didn't
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Resume();
|
void Resume();
|
||||||
|
|
||||||
bool Show( bool show = TRUE );
|
bool Show( bool show = true );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// callback for optional abort button
|
// callback for optional abort button
|
||||||
|
@@ -51,7 +51,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ public:
|
|||||||
virtual void SetUnderlined( bool underlined );
|
virtual void SetUnderlined( bool underlined );
|
||||||
virtual void SetEncoding(wxFontEncoding encoding);
|
virtual void SetEncoding(wxFontEncoding encoding);
|
||||||
|
|
||||||
virtual void SetNoAntiAliasing( bool no = TRUE );
|
virtual void SetNoAntiAliasing( bool no = true );
|
||||||
virtual bool GetNoAntiAliasing();
|
virtual bool GetNoAntiAliasing();
|
||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
|
@@ -51,7 +51,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ public:
|
|||||||
virtual void SetUnderlined( bool underlined );
|
virtual void SetUnderlined( bool underlined );
|
||||||
virtual void SetEncoding(wxFontEncoding encoding);
|
virtual void SetEncoding(wxFontEncoding encoding);
|
||||||
|
|
||||||
virtual void SetNoAntiAliasing( bool no = TRUE );
|
virtual void SetNoAntiAliasing( bool no = true );
|
||||||
virtual bool GetNoAntiAliasing();
|
virtual bool GetNoAntiAliasing();
|
||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
|
@@ -113,8 +113,8 @@ public:
|
|||||||
// Displays help window and focuses index.
|
// Displays help window and focuses index.
|
||||||
bool DisplayIndex();
|
bool DisplayIndex();
|
||||||
|
|
||||||
// Searches for keyword. Returns TRUE and display page if found, return
|
// Searches for keyword. Returns true and display page if found, return
|
||||||
// FALSE otherwise
|
// false otherwise
|
||||||
// Syntax of keyword is Altavista-like:
|
// Syntax of keyword is Altavista-like:
|
||||||
// * words are separated by spaces
|
// * words are separated by spaces
|
||||||
// (but "\"hello world\"" is only one world "hello world")
|
// (but "\"hello world\"" is only one world "hello world")
|
||||||
@@ -139,10 +139,10 @@ public:
|
|||||||
|
|
||||||
// call this to let wxHtmlHelpFrame know page changed
|
// call this to let wxHtmlHelpFrame know page changed
|
||||||
void NotifyPageChanged();
|
void NotifyPageChanged();
|
||||||
|
|
||||||
// Refreshes Contents and Index tabs
|
// Refreshes Contents and Index tabs
|
||||||
void RefreshLists();
|
void RefreshLists();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Init(wxHtmlHelpData* data = NULL);
|
void Init(wxHtmlHelpData* data = NULL);
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
virtual ~wxFrame();
|
virtual ~wxFrame();
|
||||||
|
|
||||||
virtual bool Show(bool show = TRUE);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
// Set menu bar
|
// Set menu bar
|
||||||
void SetMenuBar(wxMenuBar *menu_bar);
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
// Create toolbar
|
// Create toolbar
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
virtual wxToolBar* CreateToolBar(long style = -1,
|
virtual wxToolBar* CreateToolBar(long style = -1,
|
||||||
wxWindowID id = -1,
|
wxWindowID id = wxID_ANY,
|
||||||
const wxString& name = wxToolBarNameStr);
|
const wxString& name = wxToolBarNameStr);
|
||||||
virtual void SetToolBar(wxToolBar *toolbar);
|
virtual void SetToolBar(wxToolBar *toolbar);
|
||||||
virtual void PositionToolBar();
|
virtual void PositionToolBar();
|
||||||
@@ -74,7 +74,7 @@ public:
|
|||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
void OnActivate(wxActivateEvent& event);
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
|
||||||
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
virtual void ChangeFont(bool keepOriginalSize = true);
|
||||||
virtual void ChangeBackgroundColour();
|
virtual void ChangeBackgroundColour();
|
||||||
virtual void ChangeForegroundColour();
|
virtual void ChangeForegroundColour();
|
||||||
WXWidget GetMenuBarWidget() const;
|
WXWidget GetMenuBarWidget() const;
|
||||||
|
@@ -31,7 +31,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
int family,
|
int family,
|
||||||
int style,
|
int style,
|
||||||
int weight,
|
int weight,
|
||||||
bool underlined = FALSE,
|
bool underlined = false,
|
||||||
const wxString& face = wxEmptyString,
|
const wxString& face = wxEmptyString,
|
||||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
virtual bool IsFree() const;
|
virtual bool IsFree() const;
|
||||||
virtual bool RealizeResource();
|
virtual bool RealizeResource();
|
||||||
virtual WXHANDLE GetResourceHandle() const;
|
virtual WXHANDLE GetResourceHandle() const;
|
||||||
virtual bool FreeResource(bool force = FALSE);
|
virtual bool FreeResource(bool force = false);
|
||||||
|
|
||||||
// for consistency with other wxMSW classes
|
// for consistency with other wxMSW classes
|
||||||
WXHFONT GetHFONT() const;
|
WXHFONT GetHFONT() const;
|
||||||
|
@@ -69,7 +69,7 @@ public:
|
|||||||
// --------
|
// --------
|
||||||
wxTreeCtrl() { Init(); }
|
wxTreeCtrl() { Init(); }
|
||||||
|
|
||||||
wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
|
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
|
|
||||||
virtual ~wxTreeCtrl();
|
virtual ~wxTreeCtrl();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id = -1,
|
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
||||||
@@ -163,13 +163,13 @@ public:
|
|||||||
// allow the user to expand the items which don't have any children now
|
// allow the user to expand the items which don't have any children now
|
||||||
// - but instead add them only when needed, thus minimizing memory
|
// - but instead add them only when needed, thus minimizing memory
|
||||||
// usage and loading time.
|
// usage and loading time.
|
||||||
void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
|
void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
|
||||||
|
|
||||||
// the item will be shown in bold
|
// the item will be shown in bold
|
||||||
void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
|
void SetItemBold(const wxTreeItemId& item, bool bold = true);
|
||||||
|
|
||||||
// the item will be shown with a drop highlight
|
// the item will be shown with a drop highlight
|
||||||
void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE);
|
void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
|
||||||
|
|
||||||
// set the items text colour
|
// set the items text colour
|
||||||
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
|
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
|
||||||
@@ -197,15 +197,15 @@ public:
|
|||||||
// number of children
|
// number of children
|
||||||
// ------------------
|
// ------------------
|
||||||
|
|
||||||
// if 'recursively' is FALSE, only immediate children count, otherwise
|
// if 'recursively' is false, only immediate children count, otherwise
|
||||||
// the returned number is the number of all items in this branch
|
// the returned number is the number of all items in this branch
|
||||||
size_t GetChildrenCount(const wxTreeItemId& item,
|
size_t GetChildrenCount(const wxTreeItemId& item,
|
||||||
bool recursively = TRUE) const;
|
bool recursively = true) const;
|
||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
// wxTreeItemId.IsOk() will return FALSE if there is no such item
|
// wxTreeItemId.IsOk() will return false if there is no such item
|
||||||
|
|
||||||
// get the root tree item
|
// get the root tree item
|
||||||
wxTreeItemId GetRootItem() const;
|
wxTreeItemId GetRootItem() const;
|
||||||
@@ -225,9 +225,9 @@ public:
|
|||||||
#if WXWIN_COMPATIBILITY_2_2
|
#if WXWIN_COMPATIBILITY_2_2
|
||||||
// deprecated: Use GetItemParent instead.
|
// deprecated: Use GetItemParent instead.
|
||||||
wxTreeItemId GetParent(const wxTreeItemId& item) const
|
wxTreeItemId GetParent(const wxTreeItemId& item) const
|
||||||
{ return GetItemParent( item ); }
|
{ return GetItemParent( item ); }
|
||||||
|
|
||||||
// Expose the base class method hidden by the one above.
|
// Expose the base class method hidden by the one above.
|
||||||
wxWindow *GetParent() const { return wxControl::GetParent(); }
|
wxWindow *GetParent() const { return wxControl::GetParent(); }
|
||||||
#endif // WXWIN_COMPATIBILITY_2_2
|
#endif // WXWIN_COMPATIBILITY_2_2
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ public:
|
|||||||
// edited simultaneously)
|
// edited simultaneously)
|
||||||
wxTextCtrl* GetEditControl() const;
|
wxTextCtrl* GetEditControl() const;
|
||||||
// end editing and accept or discard the changes to item label
|
// end editing and accept or discard the changes to item label
|
||||||
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE);
|
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false);
|
||||||
|
|
||||||
// sorting
|
// sorting
|
||||||
// this function is called to compare 2 items and should return -1, 0
|
// this function is called to compare 2 items and should return -1, 0
|
||||||
@@ -371,7 +371,7 @@ public:
|
|||||||
// get the bounding rectangle of the item (or of its label only)
|
// get the bounding rectangle of the item (or of its label only)
|
||||||
bool GetBoundingRect(const wxTreeItemId& item,
|
bool GetBoundingRect(const wxTreeItemId& item,
|
||||||
wxRect& rect,
|
wxRect& rect,
|
||||||
bool textOnly = FALSE) const;
|
bool textOnly = false) const;
|
||||||
|
|
||||||
// deprecated
|
// deprecated
|
||||||
// ----------
|
// ----------
|
||||||
@@ -433,7 +433,7 @@ public:
|
|||||||
|
|
||||||
// get/set the check state for the item (only for wxTR_MULTIPLE)
|
// get/set the check state for the item (only for wxTR_MULTIPLE)
|
||||||
bool IsItemChecked(const wxTreeItemId& item) const;
|
bool IsItemChecked(const wxTreeItemId& item) const;
|
||||||
void SetItemCheck(const wxTreeItemId& item, bool check = TRUE);
|
void SetItemCheck(const wxTreeItemId& item, bool check = true);
|
||||||
|
|
||||||
// set/get the item state.image (state == -1 means cycle to the next one)
|
// set/get the item state.image (state == -1 means cycle to the next one)
|
||||||
void SetState(const wxTreeItemId& node, int state);
|
void SetState(const wxTreeItemId& node, int state);
|
||||||
@@ -491,7 +491,7 @@ private:
|
|||||||
// the hash storing the items attributes (indexed by item ids)
|
// the hash storing the items attributes (indexed by item ids)
|
||||||
wxMapTreeAttr m_attrs;
|
wxMapTreeAttr m_attrs;
|
||||||
|
|
||||||
// TRUE if the hash above is not empty
|
// true if the hash above is not empty
|
||||||
bool m_hasAnyAttr;
|
bool m_hasAnyAttr;
|
||||||
|
|
||||||
// used for dragging
|
// used for dragging
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
,int nFamily
|
,int nFamily
|
||||||
,int nStyle
|
,int nStyle
|
||||||
,int nWeight
|
,int nWeight
|
||||||
,bool bUnderlined = FALSE
|
,bool bUnderlined = false
|
||||||
,const wxString& rsFace = wxEmptyString
|
,const wxString& rsFace = wxEmptyString
|
||||||
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
|
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
|
||||||
)
|
)
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
,int nFamily
|
,int nFamily
|
||||||
,int nStyle
|
,int nStyle
|
||||||
,int nWeight
|
,int nWeight
|
||||||
,bool bUnderlined = FALSE
|
,bool bUnderlined = false
|
||||||
,const wxString& rsFace = wxEmptyString
|
,const wxString& rsFace = wxEmptyString
|
||||||
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
|
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
|
||||||
);
|
);
|
||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
virtual bool IsFree(void) const;
|
virtual bool IsFree(void) const;
|
||||||
virtual bool RealizeResource(void);
|
virtual bool RealizeResource(void);
|
||||||
virtual WXHANDLE GetResourceHandle(void);
|
virtual WXHANDLE GetResourceHandle(void);
|
||||||
virtual bool FreeResource(bool bForce = FALSE);
|
virtual bool FreeResource(bool bForce = false);
|
||||||
|
|
||||||
WXHFONT GetHFONT(void) const;
|
WXHFONT GetHFONT(void) const;
|
||||||
|
|
||||||
|
@@ -112,28 +112,28 @@ BEGIN_EVENT_TABLE(wxArtBrowserDialog, wxDialog)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
|
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
|
||||||
: wxDialog(parent, wxID_ANY, _T("Art resources browser"),
|
: wxDialog(parent, wxID_ANY, _T("Art resources browser"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
wxSizer *subsizer;
|
wxSizer *subsizer;
|
||||||
|
|
||||||
wxChoice *choice = new wxChoice(this, wxID_ANY);
|
wxChoice *choice = new wxChoice(this, wxID_ANY);
|
||||||
FillClients(choice);
|
FillClients(choice);
|
||||||
|
|
||||||
subsizer = new wxBoxSizer(wxHORIZONTAL);
|
subsizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
|
subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
subsizer->Add(choice, 1, wxLEFT, 5);
|
subsizer->Add(choice, 1, wxLEFT, 5);
|
||||||
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
|
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
|
||||||
|
|
||||||
subsizer = new wxBoxSizer(wxHORIZONTAL);
|
subsizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
|
m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
|
||||||
wxLC_REPORT | wxSUNKEN_BORDER);
|
wxLC_REPORT | wxSUNKEN_BORDER);
|
||||||
m_list->InsertColumn(0, _T("wxArtID"));
|
m_list->InsertColumn(0, _T("wxArtID"));
|
||||||
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
|
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
|
||||||
|
|
||||||
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
|
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
|
||||||
m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm));
|
m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm));
|
||||||
subsub->Add(m_canvas);
|
subsub->Add(m_canvas);
|
||||||
@@ -141,13 +141,12 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
|
|||||||
subsizer->Add(subsub);
|
subsizer->Add(subsub);
|
||||||
|
|
||||||
sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10);
|
sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10);
|
||||||
|
|
||||||
wxButton *ok = new wxButton(this, wxID_OK, _T("Close"));
|
wxButton *ok = new wxButton(this, wxID_OK, _T("Close"));
|
||||||
ok->SetDefault();
|
ok->SetDefault();
|
||||||
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
|
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
|
||||||
|
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
SetAutoLayout(true);
|
|
||||||
sizer->Fit(this);
|
sizer->Fit(this);
|
||||||
|
|
||||||
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
|
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
|
||||||
@@ -158,7 +157,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
|
|||||||
void wxArtBrowserDialog::SetArtClient(const wxArtClient& client)
|
void wxArtBrowserDialog::SetArtClient(const wxArtClient& client)
|
||||||
{
|
{
|
||||||
wxBusyCursor bcur;
|
wxBusyCursor bcur;
|
||||||
|
|
||||||
wxImageList *img = new wxImageList(16, 16);
|
wxImageList *img = new wxImageList(16, 16);
|
||||||
img->Add(wxIcon(null_xpm));
|
img->Add(wxIcon(null_xpm));
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
@@ -207,7 +207,7 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
// Make a menubar
|
// Make a menubar
|
||||||
wxMenu *file_menu = new wxMenu;
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
file_menu->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M"));
|
file_menu->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M"));
|
||||||
|
|
||||||
|
|
||||||
@@ -312,15 +312,15 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
#if wxUSE_FINDREPLDLG
|
#if wxUSE_FINDREPLDLG
|
||||||
wxMenu *find_menu = new wxMenu;
|
wxMenu *find_menu = new wxMenu;
|
||||||
find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), _T(""), true);
|
find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), wxEmptyString, true);
|
||||||
find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), _T(""), true);
|
find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), wxEmptyString, true);
|
||||||
file_menu->Append(wxID_ANY,_T("Searching"),find_menu);
|
file_menu->Append(wxID_ANY,_T("Searching"),find_menu);
|
||||||
#endif // wxUSE_FINDREPLDLG
|
#endif // wxUSE_FINDREPLDLG
|
||||||
|
|
||||||
#if USE_MODAL_PRESENTATION
|
#if USE_MODAL_PRESENTATION
|
||||||
wxMenu *modal_menu = new wxMenu;
|
wxMenu *modal_menu = new wxMenu;
|
||||||
modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W"));
|
modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W"));
|
||||||
modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), _T(""), true);
|
modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), wxEmptyString, true);
|
||||||
file_menu->Append(wxID_ANY,_T("Modal/Modeless"),modal_menu);
|
file_menu->Append(wxID_ANY,_T("Modal/Modeless"),modal_menu);
|
||||||
#endif // USE_MODAL_PRESENTATION
|
#endif // USE_MODAL_PRESENTATION
|
||||||
|
|
||||||
@@ -357,15 +357,15 @@ MyFrame::MyFrame(wxWindow *parent,
|
|||||||
m_dlgFind =
|
m_dlgFind =
|
||||||
m_dlgReplace = NULL;
|
m_dlgReplace = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_COLOURDLG
|
#if wxUSE_COLOURDLG
|
||||||
m_clrData.SetChooseFull(true);
|
m_clrData.SetChooseFull(true);
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16));
|
m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16));
|
||||||
}
|
}
|
||||||
#endif // wxUSE_COLOURDLG
|
#endif // wxUSE_COLOURDLG
|
||||||
|
|
||||||
CreateStatusBar();
|
CreateStatusBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
|
wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
|
||||||
_T("Password entry dialog"),
|
_T("Password entry dialog"),
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
this);
|
this);
|
||||||
if ( !!pwd )
|
if ( !!pwd )
|
||||||
{
|
{
|
||||||
@@ -616,8 +616,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
|||||||
(
|
(
|
||||||
this,
|
this,
|
||||||
_T("Testing open file dialog"),
|
_T("Testing open file dialog"),
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
_T("C++ files (*.cpp)|*.cpp")
|
_T("C++ files (*.cpp)|*.cpp")
|
||||||
#else
|
#else
|
||||||
@@ -649,7 +649,7 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
|
|||||||
static wxString s_extDef;
|
static wxString s_extDef;
|
||||||
wxString path = wxFileSelector(
|
wxString path = wxFileSelector(
|
||||||
_T("Select the file to load"),
|
_T("Select the file to load"),
|
||||||
_T(""), _T(""),
|
wxEmptyString, wxEmptyString,
|
||||||
s_extDef,
|
s_extDef,
|
||||||
_T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"),
|
_T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"),
|
||||||
wxCHANGE_DIR,
|
wxCHANGE_DIR,
|
||||||
@@ -668,14 +668,14 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxString wildcards =
|
wxString wildcards =
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
_T("C++ files (*.cpp)|*.cpp");
|
_T("C++ files (*.cpp)|*.cpp");
|
||||||
#else
|
#else
|
||||||
_T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
|
_T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
|
||||||
#endif
|
#endif
|
||||||
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
|
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
|
||||||
_T(""), _T(""), wildcards,
|
wxEmptyString, wxEmptyString, wildcards,
|
||||||
wxMULTIPLE);
|
wxMULTIPLE);
|
||||||
|
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
@@ -706,7 +706,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
wxFileDialog dialog(this,
|
wxFileDialog dialog(this,
|
||||||
_T("Testing save file dialog"),
|
_T("Testing save file dialog"),
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
_T("myletter.doc"),
|
_T("myletter.doc"),
|
||||||
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
|
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
|
||||||
wxSAVE|wxOVERWRITE_PROMPT);
|
wxSAVE|wxOVERWRITE_PROMPT);
|
||||||
@@ -1050,7 +1050,6 @@ MyModelessDialog::MyModelessDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5);
|
sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5);
|
||||||
sizerTop->Add(check, 1, wxEXPAND | wxALL, 5);
|
sizerTop->Add(check, 1, wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->SetSizeHints(this);
|
sizerTop->SetSizeHints(this);
|
||||||
@@ -1094,7 +1093,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->SetSizeHints(this);
|
sizerTop->SetSizeHints(this);
|
||||||
@@ -1118,7 +1116,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event)
|
|||||||
#if wxUSE_TEXTDLG
|
#if wxUSE_TEXTDLG
|
||||||
wxGetTextFromUser(_T("Dummy prompt"),
|
wxGetTextFromUser(_T("Dummy prompt"),
|
||||||
_T("Modal dialog called from dialog"),
|
_T("Modal dialog called from dialog"),
|
||||||
_T(""), this);
|
wxEmptyString, this);
|
||||||
#else
|
#else
|
||||||
wxMessageBox(_T("Modal dialog called from dialog"));
|
wxMessageBox(_T("Modal dialog called from dialog"));
|
||||||
#endif // wxUSE_TEXTDLG
|
#endif // wxUSE_TEXTDLG
|
||||||
|
@@ -146,18 +146,18 @@ GridFrame::GridFrame()
|
|||||||
fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") );
|
fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") );
|
||||||
|
|
||||||
wxMenu *viewMenu = new wxMenu;
|
wxMenu *viewMenu = new wxMenu;
|
||||||
viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width..."), _T("") );
|
viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") );
|
||||||
viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width..."), _T("") );
|
viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") );
|
||||||
viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") );
|
viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") );
|
||||||
viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK );
|
||||||
viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), _T(""), wxITEM_CHECK );
|
viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK );
|
||||||
|
|
||||||
wxMenu *rowLabelMenu = new wxMenu;
|
wxMenu *rowLabelMenu = new wxMenu;
|
||||||
|
|
||||||
@@ -344,7 +344,6 @@ GridFrame::GridFrame()
|
|||||||
0,
|
0,
|
||||||
wxEXPAND );
|
wxEXPAND );
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer( topSizer );
|
SetSizer( topSizer );
|
||||||
|
|
||||||
topSizer->Fit( this );
|
topSizer->Fit( this );
|
||||||
@@ -761,7 +760,7 @@ void GridFrame::OnAddToSelectToggle(wxCommandEvent& event)
|
|||||||
|
|
||||||
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
|
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
if ( ev.GetRow() != -1 )
|
if ( ev.GetRow() != -1 )
|
||||||
{
|
{
|
||||||
logBuf << _T("Left click on row label ") << ev.GetRow();
|
logBuf << _T("Left click on row label ") << ev.GetRow();
|
||||||
@@ -787,7 +786,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnCellLeftClick( wxGridEvent& ev )
|
void GridFrame::OnCellLeftClick( wxGridEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
logBuf << _T("Left click at row ") << ev.GetRow()
|
logBuf << _T("Left click at row ") << ev.GetRow()
|
||||||
<< _T(" col ") << ev.GetCol();
|
<< _T(" col ") << ev.GetCol();
|
||||||
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
||||||
@@ -801,7 +800,7 @@ void GridFrame::OnCellLeftClick( wxGridEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnRowSize( wxGridSizeEvent& ev )
|
void GridFrame::OnRowSize( wxGridSizeEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
logBuf << _T("Resized row ") << ev.GetRowOrCol();
|
logBuf << _T("Resized row ") << ev.GetRowOrCol();
|
||||||
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
||||||
|
|
||||||
@@ -811,7 +810,7 @@ void GridFrame::OnRowSize( wxGridSizeEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnColSize( wxGridSizeEvent& ev )
|
void GridFrame::OnColSize( wxGridSizeEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
logBuf << _T("Resized col ") << ev.GetRowOrCol();
|
logBuf << _T("Resized col ") << ev.GetRowOrCol();
|
||||||
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
wxLogMessage( wxT("%s"), logBuf.c_str() );
|
||||||
|
|
||||||
@@ -821,7 +820,7 @@ void GridFrame::OnColSize( wxGridSizeEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnSelectCell( wxGridEvent& ev )
|
void GridFrame::OnSelectCell( wxGridEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
if ( ev.Selecting() )
|
if ( ev.Selecting() )
|
||||||
logBuf << _T("Selected ");
|
logBuf << _T("Selected ");
|
||||||
else
|
else
|
||||||
@@ -841,7 +840,7 @@ void GridFrame::OnSelectCell( wxGridEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
|
void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
if ( ev.Selecting() )
|
if ( ev.Selecting() )
|
||||||
logBuf << _T("Selected ");
|
logBuf << _T("Selected ");
|
||||||
else
|
else
|
||||||
@@ -861,7 +860,7 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
|
|||||||
|
|
||||||
void GridFrame::OnCellValueChanged( wxGridEvent& ev )
|
void GridFrame::OnCellValueChanged( wxGridEvent& ev )
|
||||||
{
|
{
|
||||||
logBuf = _T("");
|
logBuf = wxEmptyString;
|
||||||
logBuf << _T("Value changed for cell at")
|
logBuf << _T("Value changed for cell at")
|
||||||
<< _T(" row ") << ev.GetRow()
|
<< _T(" row ") << ev.GetRow()
|
||||||
<< _T(" col ") << ev.GetCol();
|
<< _T(" col ") << ev.GetCol();
|
||||||
|
@@ -595,7 +595,7 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController)
|
|||||||
{
|
{
|
||||||
wxString key = wxGetTextFromUser(_T("Search for?"),
|
wxString key = wxGetTextFromUser(_T("Search for?"),
|
||||||
_T("Search help for keyword"),
|
_T("Search help for keyword"),
|
||||||
_T(""),
|
wxEmptyString,
|
||||||
this);
|
this);
|
||||||
if(! key.IsEmpty())
|
if(! key.IsEmpty())
|
||||||
helpController.KeywordSearch(key);
|
helpController.KeywordSearch(key);
|
||||||
@@ -666,7 +666,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->SetSizeHints(this);
|
sizerTop->SetSizeHints(this);
|
||||||
|
@@ -166,19 +166,18 @@
|
|||||||
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
|
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
|
||||||
html -> SetBorders(0);
|
html -> SetBorders(0);
|
||||||
html -> LoadPage(wxT("data/about.htm"));
|
html -> LoadPage(wxT("data/about.htm"));
|
||||||
html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
|
html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
|
||||||
html -> GetInternalRepresentation() -> GetHeight());
|
html -> GetInternalRepresentation() -> GetHeight());
|
||||||
|
|
||||||
topsizer -> Add(html, 1, wxALL, 10);
|
topsizer -> Add(html, 1, wxALL, 10);
|
||||||
|
|
||||||
topsizer -> Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
|
topsizer -> Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
|
||||||
|
|
||||||
wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK"));
|
wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK"));
|
||||||
bu1 -> SetDefault();
|
bu1 -> SetDefault();
|
||||||
|
|
||||||
topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
|
topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
|
||||||
|
|
||||||
dlg.SetAutoLayout(true);
|
|
||||||
dlg.SetSizer(topsizer);
|
dlg.SetSizer(topsizer);
|
||||||
topsizer -> Fit(&dlg);
|
topsizer -> Fit(&dlg);
|
||||||
|
|
||||||
|
@@ -400,14 +400,14 @@ LboxTestFrame::LboxTestFrame(const wxString& title)
|
|||||||
|
|
||||||
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btn = new wxButton(panel, LboxTest_Change, _T("C&hange current"));
|
btn = new wxButton(panel, LboxTest_Change, _T("C&hange current"));
|
||||||
m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, _T(""));
|
m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, wxEmptyString);
|
||||||
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
||||||
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
|
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item"));
|
btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item"));
|
||||||
m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, _T(""));
|
m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, wxEmptyString);
|
||||||
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
||||||
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
|
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
@@ -457,7 +457,6 @@ LboxTestFrame::LboxTestFrame(const wxString& title)
|
|||||||
Reset();
|
Reset();
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
|
|
||||||
panel->SetAutoLayout(true);
|
|
||||||
panel->SetSizer(sizerTop);
|
panel->SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
|
@@ -315,8 +315,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
|||||||
|
|
||||||
m_panel->SetSizer(m_sizerFrame);
|
m_panel->SetSizer(m_sizerFrame);
|
||||||
|
|
||||||
m_panel->SetAutoLayout(true);
|
|
||||||
|
|
||||||
m_sizerFrame->Fit(this);
|
m_sizerFrame->Fit(this);
|
||||||
m_sizerFrame->SetSizeHints(this);
|
m_sizerFrame->SetSizeHints(this);
|
||||||
|
|
||||||
|
@@ -492,7 +492,6 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(-1, 10, 1, wxGROW);
|
sizerTop->Add(-1, 10, 1, wxGROW);
|
||||||
sizerTop->Add(statbarBottom, 0, wxGROW);
|
sizerTop->Add(statbarBottom, 0, wxGROW);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -620,7 +619,7 @@ void MyStatusBar::DoToggle()
|
|||||||
m_statbmp->Refresh();
|
m_statbmp->Refresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetStatusText(_T(""), Field_Clock);
|
SetStatusText(wxEmptyString, Field_Clock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@
|
|||||||
class WXDLLEXPORT wxFontPreviewer : public wxWindow
|
class WXDLLEXPORT wxFontPreviewer : public wxWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxFontPreviewer(wxWindow *parent) : wxWindow(parent, -1) {}
|
wxFontPreviewer(wxWindow *parent) : wxWindow(parent, wxID_ANY) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
@@ -82,7 +82,7 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
dc.GetTextExtent( wxT("X"), &w, &h);
|
dc.GetTextExtent( wxT("X"), &w, &h);
|
||||||
dc.SetTextForeground(GetForegroundColour());
|
dc.SetTextForeground(GetForegroundColour());
|
||||||
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
|
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
|
||||||
dc.DrawText(_("ABCDEFGabcdefg12345"),
|
dc.DrawText(_("ABCDEFGabcdefg12345"),
|
||||||
10, size.y/2 - h/2);
|
10, size.y/2 - h/2);
|
||||||
dc.DestroyClippingRegion();
|
dc.DestroyClippingRegion();
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"),
|
|||||||
|
|
||||||
void wxGenericFontDialog::Init()
|
void wxGenericFontDialog::Init()
|
||||||
{
|
{
|
||||||
m_useEvents = FALSE;
|
m_useEvents = false;
|
||||||
m_previewer = NULL;
|
m_previewer = NULL;
|
||||||
Create( m_parent ) ;
|
Create( m_parent ) ;
|
||||||
}
|
}
|
||||||
@@ -183,21 +183,21 @@ void wxGenericFontDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
bool wxGenericFontDialog::DoCreate(wxWindow *parent)
|
bool wxGenericFontDialog::DoCreate(wxWindow *parent)
|
||||||
{
|
{
|
||||||
if ( !wxDialog::Create( parent , -1 , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
|
if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
|
||||||
_T("fontdialog") ) )
|
_T("fontdialog") ) )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxFontDialog creation failed") );
|
wxFAIL_MSG( wxT("wxFontDialog creation failed") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeFont();
|
InitializeFont();
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
|
||||||
// sets initial font in preview area
|
// sets initial font in preview area
|
||||||
wxCommandEvent dummy;
|
wxCommandEvent dummy;
|
||||||
OnChangeFont(dummy);
|
OnChangeFont(dummy);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxGenericFontDialog::ShowModal()
|
int wxGenericFontDialog::ShowModal()
|
||||||
@@ -300,13 +300,13 @@ void wxGenericFontDialog::CreateWidgets()
|
|||||||
sizer->Add(weightChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
sizer->Add(weightChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
||||||
sizer->Add(colourChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
sizer->Add(colourChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
||||||
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
|
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
|
||||||
|
|
||||||
sizer = new wxBoxSizer(wxHORIZONTAL);
|
sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer->Add(pointSizeChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
sizer->Add(pointSizeChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
|
||||||
sizer->Add(underLineCheckBox, 0, wxALIGN_CENTER | wxLEFT, 10);
|
sizer->Add(underLineCheckBox, 0, wxALIGN_CENTER | wxLEFT, 10);
|
||||||
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
|
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
topsizer->Add(m_previewer, 1, wxALL | wxEXPAND, 10);
|
topsizer->Add(m_previewer, 1, wxALL | wxEXPAND, 10);
|
||||||
topsizer->SetItemMinSize(m_previewer, 430, 100);
|
topsizer->SetItemMinSize(m_previewer, 430, 100);
|
||||||
|
|
||||||
@@ -315,7 +315,6 @@ void wxGenericFontDialog::CreateWidgets()
|
|||||||
sizer->Add(cancelButton, 0, wxRIGHT, 10);
|
sizer->Add(cancelButton, 0, wxRIGHT, 10);
|
||||||
topsizer->Add(sizer, 0, wxALIGN_RIGHT | wxBOTTOM, 10);
|
topsizer->Add(sizer, 0, wxALIGN_RIGHT | wxBOTTOM, 10);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(topsizer);
|
SetSizer(topsizer);
|
||||||
topsizer->SetSizeHints(this);
|
topsizer->SetSizeHints(this);
|
||||||
topsizer->Fit(this);
|
topsizer->Fit(this);
|
||||||
@@ -326,9 +325,9 @@ void wxGenericFontDialog::CreateWidgets()
|
|||||||
delete[] styles;
|
delete[] styles;
|
||||||
delete[] weights;
|
delete[] weights;
|
||||||
delete[] pointSizes;
|
delete[] pointSizes;
|
||||||
|
|
||||||
// Don't block events any more
|
// Don't block events any more
|
||||||
m_useEvents = TRUE;
|
m_useEvents = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericFontDialog::InitializeFont()
|
void wxGenericFontDialog::InitializeFont()
|
||||||
@@ -337,7 +336,7 @@ void wxGenericFontDialog::InitializeFont()
|
|||||||
int fontWeight = wxNORMAL;
|
int fontWeight = wxNORMAL;
|
||||||
int fontStyle = wxNORMAL;
|
int fontStyle = wxNORMAL;
|
||||||
int fontSize = 12;
|
int fontSize = 12;
|
||||||
int fontUnderline = FALSE;
|
bool fontUnderline = false;
|
||||||
|
|
||||||
if (m_fontData.m_initialFont.Ok())
|
if (m_fontData.m_initialFont.Ok())
|
||||||
{
|
{
|
||||||
@@ -348,7 +347,8 @@ void wxGenericFontDialog::InitializeFont()
|
|||||||
fontUnderline = m_fontData.m_initialFont.GetUnderlined();
|
fontUnderline = m_fontData.m_initialFont.GetUnderlined();
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
|
dialogFont = wxFont(fontSize, fontFamily, fontStyle,
|
||||||
|
fontWeight, fontUnderline);
|
||||||
|
|
||||||
if (m_previewer)
|
if (m_previewer)
|
||||||
m_previewer->SetFont(dialogFont);
|
m_previewer->SetFont(dialogFont);
|
||||||
@@ -366,7 +366,7 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
|
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
|
||||||
m_previewer->SetFont(dialogFont);
|
m_previewer->SetFont(dialogFont);
|
||||||
if (colourChoice->GetStringSelection() != wxT(""))
|
if ( !colourChoice->GetStringSelection().empty() )
|
||||||
{
|
{
|
||||||
wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection());
|
wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection());
|
||||||
if (col.Ok())
|
if (col.Ok())
|
||||||
|
@@ -156,7 +156,7 @@ BEGIN_EVENT_TABLE(wxLogDialog, wxDialog)
|
|||||||
#if wxUSE_FILE
|
#if wxUSE_FILE
|
||||||
EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave)
|
EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave)
|
||||||
#endif // wxUSE_FILE
|
#endif // wxUSE_FILE
|
||||||
EVT_LIST_ITEM_SELECTED(-1, wxLogDialog::OnListSelect)
|
EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#endif // wxUSE_LOG_DIALOG
|
#endif // wxUSE_LOG_DIALOG
|
||||||
@@ -168,8 +168,8 @@ END_EVENT_TABLE()
|
|||||||
#if wxUSE_FILE && wxUSE_FILEDLG
|
#if wxUSE_FILE && wxUSE_FILEDLG
|
||||||
|
|
||||||
// pass an uninitialized file object, the function will ask the user for the
|
// pass an uninitialized file object, the function will ask the user for the
|
||||||
// filename and try to open it, returns TRUE on success (file was opened),
|
// filename and try to open it, returns true on success (file was opened),
|
||||||
// FALSE if file couldn't be opened/created and -1 if the file selection
|
// false if file couldn't be opened/created and -1 if the file selection
|
||||||
// dialog was cancelled
|
// dialog was cancelled
|
||||||
static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL);
|
static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL);
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ void wxLogGui::Clear()
|
|||||||
{
|
{
|
||||||
m_bErrors =
|
m_bErrors =
|
||||||
m_bWarnings =
|
m_bWarnings =
|
||||||
m_bHasMessages = FALSE;
|
m_bHasMessages = false;
|
||||||
|
|
||||||
m_aMessages.Empty();
|
m_aMessages.Empty();
|
||||||
m_aSeverity.Empty();
|
m_aSeverity.Empty();
|
||||||
@@ -248,7 +248,7 @@ void wxLogGui::Flush()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// do it right now to block any new calls to Flush() while we're here
|
// do it right now to block any new calls to Flush() while we're here
|
||||||
m_bHasMessages = FALSE;
|
m_bHasMessages = false;
|
||||||
|
|
||||||
wxString appName = wxTheApp->GetAppName();
|
wxString appName = wxTheApp->GetAppName();
|
||||||
if ( !!appName )
|
if ( !!appName )
|
||||||
@@ -340,7 +340,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
|
|||||||
m_aMessages.Add(szString);
|
m_aMessages.Add(szString);
|
||||||
m_aSeverity.Add(wxLOG_Message);
|
m_aSeverity.Add(wxLOG_Message);
|
||||||
m_aTimes.Add((long)t);
|
m_aTimes.Add((long)t);
|
||||||
m_bHasMessages = TRUE;
|
m_bHasMessages = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -404,20 +404,20 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
|
|||||||
m_aSeverity.Empty();
|
m_aSeverity.Empty();
|
||||||
m_aTimes.Empty();
|
m_aTimes.Empty();
|
||||||
#endif // wxUSE_LOG_DIALOG
|
#endif // wxUSE_LOG_DIALOG
|
||||||
m_bErrors = TRUE;
|
m_bErrors = true;
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case wxLOG_Warning:
|
case wxLOG_Warning:
|
||||||
if ( !m_bErrors ) {
|
if ( !m_bErrors ) {
|
||||||
// for the warning we don't discard the info messages
|
// for the warning we don't discard the info messages
|
||||||
m_bWarnings = TRUE;
|
m_bWarnings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_aMessages.Add(szString);
|
m_aMessages.Add(szString);
|
||||||
m_aSeverity.Add((int)level);
|
m_aSeverity.Add((int)level);
|
||||||
m_aTimes.Add((long)t);
|
m_aTimes.Add((long)t);
|
||||||
m_bHasMessages = TRUE;
|
m_bHasMessages = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -479,11 +479,11 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle)
|
wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle)
|
||||||
: wxFrame(pParent, -1, szTitle)
|
: wxFrame(pParent, wxID_ANY, szTitle)
|
||||||
{
|
{
|
||||||
m_log = log;
|
m_log = log;
|
||||||
|
|
||||||
m_pTextCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition,
|
m_pTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxTE_MULTILINE |
|
wxTE_MULTILINE |
|
||||||
wxHSCROLL |
|
wxHSCROLL |
|
||||||
@@ -522,7 +522,7 @@ void wxLogFrame::DoClose()
|
|||||||
{
|
{
|
||||||
// instead of closing just hide the window to be able to Show() it
|
// instead of closing just hide the window to be able to Show() it
|
||||||
// later
|
// later
|
||||||
Show(FALSE);
|
Show(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,7 +595,7 @@ wxLogWindow::wxLogWindow(wxFrame *pParent,
|
|||||||
m_pLogFrame = new wxLogFrame(pParent, this, szTitle);
|
m_pLogFrame = new wxLogFrame(pParent, this, szTitle);
|
||||||
|
|
||||||
if ( bShow )
|
if ( bShow )
|
||||||
m_pLogFrame->Show(TRUE);
|
m_pLogFrame->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxLogWindow::Show(bool bShow)
|
void wxLogWindow::Show(bool bShow)
|
||||||
@@ -667,7 +667,7 @@ void wxLogWindow::OnFrameCreate(wxFrame * WXUNUSED(frame))
|
|||||||
bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame))
|
bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame))
|
||||||
{
|
{
|
||||||
// allow to close
|
// allow to close
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame))
|
void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame))
|
||||||
@@ -697,7 +697,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
const wxArrayLong& times,
|
const wxArrayLong& times,
|
||||||
const wxString& caption,
|
const wxString& caption,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog(parent, -1, caption,
|
: wxDialog(parent, wxID_ANY, caption,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
@@ -728,7 +728,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
while ( !!msg );
|
while ( !!msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_showingDetails = FALSE; // not initially
|
m_showingDetails = false; // not initially
|
||||||
m_listctrl = (wxListCtrl *)NULL;
|
m_listctrl = (wxListCtrl *)NULL;
|
||||||
|
|
||||||
#if wxUSE_STATLINE
|
#if wxUSE_STATLINE
|
||||||
@@ -781,7 +781,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
default:
|
default:
|
||||||
wxFAIL_MSG(_T("incorrect log style"));
|
wxFAIL_MSG(_T("incorrect log style"));
|
||||||
}
|
}
|
||||||
sizerAll->Add(new wxStaticBitmap(this, -1, bitmap), 0);
|
sizerAll->Add(new wxStaticBitmap(this, wxID_ANY, bitmap), 0);
|
||||||
|
|
||||||
const wxString& message = messages.Last();
|
const wxString& message = messages.Last();
|
||||||
sizerAll->Add(CreateTextSizer(message), 1,
|
sizerAll->Add(CreateTextSizer(message), 1,
|
||||||
@@ -790,7 +790,6 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
|
|
||||||
sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN);
|
sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
// see comments in OnDetails()
|
// see comments in OnDetails()
|
||||||
@@ -830,11 +829,11 @@ void wxLogDialog::CreateDetailsControls()
|
|||||||
#endif // wxUSE_FILE
|
#endif // wxUSE_FILE
|
||||||
|
|
||||||
#if wxUSE_STATLINE
|
#if wxUSE_STATLINE
|
||||||
m_statline = new wxStaticLine(this, -1);
|
m_statline = new wxStaticLine(this, wxID_ANY);
|
||||||
#endif // wxUSE_STATLINE
|
#endif // wxUSE_STATLINE
|
||||||
|
|
||||||
// create the list ctrl now
|
// create the list ctrl now
|
||||||
m_listctrl = new wxListCtrl(this, -1,
|
m_listctrl = new wxListCtrl(this, wxID_ANY,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxSUNKEN_BORDER |
|
wxSUNKEN_BORDER |
|
||||||
wxLC_REPORT |
|
wxLC_REPORT |
|
||||||
@@ -858,7 +857,7 @@ void wxLogDialog::CreateDetailsControls()
|
|||||||
wxART_INFORMATION
|
wxART_INFORMATION
|
||||||
};
|
};
|
||||||
|
|
||||||
bool loadedIcons = TRUE;
|
bool loadedIcons = true;
|
||||||
|
|
||||||
for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ )
|
for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ )
|
||||||
{
|
{
|
||||||
@@ -869,7 +868,7 @@ void wxLogDialog::CreateDetailsControls()
|
|||||||
// Degrade gracefully.
|
// Degrade gracefully.
|
||||||
if ( !bmp.Ok() )
|
if ( !bmp.Ok() )
|
||||||
{
|
{
|
||||||
loadedIcons = FALSE;
|
loadedIcons = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1077,7 +1076,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
|
|||||||
// VS: this is neccessary in order to force frame redraw under
|
// VS: this is neccessary in order to force frame redraw under
|
||||||
// WindowMaker or fvwm2 (and probably other broken WMs).
|
// WindowMaker or fvwm2 (and probably other broken WMs).
|
||||||
// Otherwise, detailed list wouldn't be displayed.
|
// Otherwise, detailed list wouldn't be displayed.
|
||||||
Show(TRUE);
|
Show();
|
||||||
#endif // wxGTK
|
#endif // wxGTK
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1094,8 +1093,8 @@ wxLogDialog::~wxLogDialog()
|
|||||||
#if wxUSE_FILE && wxUSE_FILEDLG
|
#if wxUSE_FILE && wxUSE_FILEDLG
|
||||||
|
|
||||||
// pass an uninitialized file object, the function will ask the user for the
|
// pass an uninitialized file object, the function will ask the user for the
|
||||||
// filename and try to open it, returns TRUE on success (file was opened),
|
// filename and try to open it, returns true on success (file was opened),
|
||||||
// FALSE if file couldn't be opened/created and -1 if the file selection
|
// false if file couldn't be opened/created and -1 if the file selection
|
||||||
// dialog was cancelled
|
// dialog was cancelled
|
||||||
static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
||||||
{
|
{
|
||||||
@@ -1111,18 +1110,18 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
|||||||
// ---------
|
// ---------
|
||||||
bool bOk;
|
bool bOk;
|
||||||
if ( wxFile::Exists(filename) ) {
|
if ( wxFile::Exists(filename) ) {
|
||||||
bool bAppend = FALSE;
|
bool bAppend = false;
|
||||||
wxString strMsg;
|
wxString strMsg;
|
||||||
strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"),
|
strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"),
|
||||||
filename.c_str());
|
filename.c_str());
|
||||||
switch ( wxMessageBox(strMsg, _("Question"),
|
switch ( wxMessageBox(strMsg, _("Question"),
|
||||||
wxICON_QUESTION | wxYES_NO | wxCANCEL) ) {
|
wxICON_QUESTION | wxYES_NO | wxCANCEL) ) {
|
||||||
case wxYES:
|
case wxYES:
|
||||||
bAppend = TRUE;
|
bAppend = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxNO:
|
case wxNO:
|
||||||
bAppend = FALSE;
|
bAppend = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxCANCEL:
|
case wxCANCEL:
|
||||||
@@ -1136,7 +1135,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
|||||||
bOk = file.Open(filename, wxFile::write_append);
|
bOk = file.Open(filename, wxFile::write_append);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bOk = file.Create(filename, TRUE /* overwrite */);
|
bOk = file.Create(filename, true /* overwrite */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -85,7 +85,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
int maximum,
|
int maximum,
|
||||||
wxWindow *parent,
|
wxWindow *parent,
|
||||||
int style)
|
int style)
|
||||||
: wxDialog(parent, -1, title)
|
: wxDialog(parent, wxID_ANY, title)
|
||||||
{
|
{
|
||||||
// we may disappear at any moment, let the others know about it
|
// we may disappear at any moment, let the others know about it
|
||||||
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
|
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
|
||||||
@@ -101,7 +101,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
// FIXME: should probably have a (extended?) window style for this
|
// FIXME: should probably have a (extended?) window style for this
|
||||||
if ( !hasAbortButton )
|
if ( !hasAbortButton )
|
||||||
{
|
{
|
||||||
EnableCloseButton(FALSE);
|
EnableCloseButton(false);
|
||||||
}
|
}
|
||||||
#endif // wxMSW
|
#endif // wxMSW
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
long widthText;
|
long widthText;
|
||||||
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
|
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
m_msg = new wxStaticText(this, -1, message);
|
m_msg = new wxStaticText(this, wxID_ANY, message);
|
||||||
c = new wxLayoutConstraints;
|
c = new wxLayoutConstraints;
|
||||||
c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
|
c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
|
||||||
c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
|
c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
|
||||||
@@ -143,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
// note that we can't use wxGA_SMOOTH because it happens to
|
// note that we can't use wxGA_SMOOTH because it happens to
|
||||||
// cause the dialog to be modal. Have an extra
|
// cause the dialog to be modal. Have an extra
|
||||||
// style argument to wxProgressDialog, perhaps.
|
// style argument to wxProgressDialog, perhaps.
|
||||||
m_gauge = new wxGauge(this, -1, m_maximum,
|
m_gauge = new wxGauge(this, wxID_ANY, m_maximum,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxGA_HORIZONTAL);
|
wxGA_HORIZONTAL);
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
m_btnAbort = (wxButton *)NULL;
|
m_btnAbort = (wxButton *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
SetAutoLayout(true);
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
sizeDlg.y += 2*LAYOUT_Y_MARGIN;
|
sizeDlg.y += 2*LAYOUT_Y_MARGIN;
|
||||||
@@ -247,12 +247,12 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( m_parentTop )
|
if ( m_parentTop )
|
||||||
m_parentTop->Enable(FALSE);
|
m_parentTop->Disable();
|
||||||
m_winDisabler = NULL;
|
m_winDisabler = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Show(TRUE);
|
Show();
|
||||||
Enable(TRUE); // enable this window
|
Enable();
|
||||||
|
|
||||||
// this one can be initialized even if the others are unknown for now
|
// this one can be initialized even if the others are unknown for now
|
||||||
//
|
//
|
||||||
@@ -270,7 +270,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
|
|||||||
{
|
{
|
||||||
wxLayoutConstraints *c;
|
wxLayoutConstraints *c;
|
||||||
|
|
||||||
wxStaticText *label = new wxStaticText(this, -1, _("unknown"));
|
wxStaticText *label = new wxStaticText(this, wxID_ANY, _("unknown"));
|
||||||
c = new wxLayoutConstraints;
|
c = new wxLayoutConstraints;
|
||||||
|
|
||||||
// VZ: I like the labels be centered - if the others don't mind, you may
|
// VZ: I like the labels be centered - if the others don't mind, you may
|
||||||
@@ -285,7 +285,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
|
|||||||
c->height.AsIs();
|
c->height.AsIs();
|
||||||
label->SetConstraints(c);
|
label->SetConstraints(c);
|
||||||
|
|
||||||
wxStaticText *dummy = new wxStaticText(this, -1, text);
|
wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text);
|
||||||
c = new wxLayoutConstraints;
|
c = new wxLayoutConstraints;
|
||||||
c->right.LeftOf(label);
|
c->right.LeftOf(label);
|
||||||
c->top.SameAs(label, wxTop, 0);
|
c->top.SameAs(label, wxTop, 0);
|
||||||
@@ -338,7 +338,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
|
|
||||||
if ( value == m_maximum )
|
if ( value == m_maximum )
|
||||||
{
|
{
|
||||||
// so that we return TRUE below and that out [Cancel] handler knew what
|
// so that we return true below and that out [Cancel] handler knew what
|
||||||
// to do
|
// to do
|
||||||
m_state = Finished;
|
m_state = Finished;
|
||||||
if( !(GetWindowStyle() & wxPD_AUTO_HIDE) )
|
if( !(GetWindowStyle() & wxPD_AUTO_HIDE) )
|
||||||
@@ -351,7 +351,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
||||||
else // enable the button to give the user a way to close the dlg
|
else // enable the button to give the user a way to close the dlg
|
||||||
{
|
{
|
||||||
EnableCloseButton(TRUE);
|
EnableCloseButton();
|
||||||
}
|
}
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ void wxProgressDialog::OnClose(wxCloseEvent& event)
|
|||||||
if ( m_state == Uncancelable )
|
if ( m_state == Uncancelable )
|
||||||
{
|
{
|
||||||
// can't close this dialog
|
// can't close this dialog
|
||||||
event.Veto(TRUE);
|
event.Veto();
|
||||||
}
|
}
|
||||||
else if ( m_state == Finished )
|
else if ( m_state == Finished )
|
||||||
{
|
{
|
||||||
@@ -471,7 +471,7 @@ void wxProgressDialog::ReenableOtherWindows()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( m_parentTop )
|
if ( m_parentTop )
|
||||||
m_parentTop->Enable(TRUE);
|
m_parentTop->Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -100,7 +100,7 @@ public:
|
|||||||
wxTipProvider *tipProvider,
|
wxTipProvider *tipProvider,
|
||||||
bool showAtStartup);
|
bool showAtStartup);
|
||||||
|
|
||||||
// the tip dialog has "Show tips on startup" checkbox - return TRUE if it
|
// the tip dialog has "Show tips on startup" checkbox - return true if it
|
||||||
// was checked (or wasn't unchecked)
|
// was checked (or wasn't unchecked)
|
||||||
bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); }
|
bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); }
|
||||||
|
|
||||||
@@ -142,34 +142,34 @@ wxString wxFileTipProvider::GetTip()
|
|||||||
{
|
{
|
||||||
return _("Tips not available, sorry!");
|
return _("Tips not available, sorry!");
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString tip;
|
wxString tip;
|
||||||
|
|
||||||
// Comments start with a # symbol.
|
// Comments start with a # symbol.
|
||||||
// Loop reading lines until get the first one that isn't a comment.
|
// Loop reading lines until get the first one that isn't a comment.
|
||||||
// The max number of loop executions is the number of lines in the
|
// The max number of loop executions is the number of lines in the
|
||||||
// textfile so that can't go into an eternal loop in the [oddball]
|
// textfile so that can't go into an eternal loop in the [oddball]
|
||||||
// case of a comment-only tips file, or the developer has vetoed
|
// case of a comment-only tips file, or the developer has vetoed
|
||||||
// them all via PreprecessTip().
|
// them all via PreprecessTip().
|
||||||
for ( size_t i=0; i < count; i++ )
|
for ( size_t i=0; i < count; i++ )
|
||||||
{
|
{
|
||||||
// The current tip may be at the last line of the textfile, (or
|
// The current tip may be at the last line of the textfile, (or
|
||||||
// past it, if the number of lines in the textfile changed, such
|
// past it, if the number of lines in the textfile changed, such
|
||||||
// as changing to a different textfile, with less tips). So check
|
// as changing to a different textfile, with less tips). So check
|
||||||
// to see at last line of text file, (or past it)...
|
// to see at last line of text file, (or past it)...
|
||||||
if ( m_currentTip >= count )
|
if ( m_currentTip >= count )
|
||||||
{
|
{
|
||||||
// .. and if so, wrap back to line 0.
|
// .. and if so, wrap back to line 0.
|
||||||
m_currentTip = 0;
|
m_currentTip = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the tip, and increment the current tip counter.
|
// Read the tip, and increment the current tip counter.
|
||||||
tip = m_textfile.GetLine(m_currentTip++);
|
tip = m_textfile.GetLine(m_currentTip++);
|
||||||
|
|
||||||
// Allow a derived class's overrided virtual to modify the tip
|
// Allow a derived class's overrided virtual to modify the tip
|
||||||
// now if so desired.
|
// now if so desired.
|
||||||
tip = PreprocessTip(tip);
|
tip = PreprocessTip(tip);
|
||||||
|
|
||||||
// Break if tip isn't a comment, and isn't an empty string
|
// Break if tip isn't a comment, and isn't an empty string
|
||||||
// (or only stray space characters).
|
// (or only stray space characters).
|
||||||
if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) )
|
if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) )
|
||||||
@@ -177,18 +177,18 @@ wxString wxFileTipProvider::GetTip()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If tip starts with '_(', then it is a gettext string of format
|
// If tip starts with '_(', then it is a gettext string of format
|
||||||
// _("My \"global\" tip text") so first strip off the leading '_("'...
|
// _("My \"global\" tip text") so first strip off the leading '_("'...
|
||||||
if ( tip.StartsWith(wxT("_(\"" ), &tip))
|
if ( tip.StartsWith(wxT("_(\"" ), &tip))
|
||||||
{
|
{
|
||||||
//...and strip off the trailing '")'...
|
//...and strip off the trailing '")'...
|
||||||
tip = tip.BeforeLast(wxT('\"'));
|
tip = tip.BeforeLast(wxT('\"'));
|
||||||
// ...and replace escaped quotes
|
// ...and replace escaped quotes
|
||||||
tip.Replace(wxT("\\\""), wxT("\""));
|
tip.Replace(wxT("\\\""), wxT("\""));
|
||||||
}
|
}
|
||||||
|
|
||||||
return tip;
|
return tip;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -202,7 +202,7 @@ END_EVENT_TABLE()
|
|||||||
wxTipDialog::wxTipDialog(wxWindow *parent,
|
wxTipDialog::wxTipDialog(wxWindow *parent,
|
||||||
wxTipProvider *tipProvider,
|
wxTipProvider *tipProvider,
|
||||||
bool showAtStartup)
|
bool showAtStartup)
|
||||||
: wxDialog(parent, -1, _("Tip of the Day"),
|
: wxDialog(parent, wxID_ANY, _("Tip of the Day"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
@@ -212,12 +212,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
|||||||
|
|
||||||
wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close"));
|
wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close"));
|
||||||
|
|
||||||
m_checkbox = new wxCheckBox(this, -1, _("&Show tips at startup"));
|
m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup"));
|
||||||
m_checkbox->SetValue(showAtStartup);
|
m_checkbox->SetValue(showAtStartup);
|
||||||
|
|
||||||
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip"));
|
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip"));
|
||||||
|
|
||||||
wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) );
|
wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) );
|
||||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||||
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
|
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
|
||||||
#else
|
#else
|
||||||
@@ -226,7 +226,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
|||||||
//
|
//
|
||||||
// text->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
|
// text->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
|
||||||
|
|
||||||
m_text = new wxTextCtrl(this, -1, wxT(""),
|
m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxSize(200, 160),
|
wxDefaultPosition, wxSize(200, 160),
|
||||||
wxTE_MULTILINE |
|
wxTE_MULTILINE |
|
||||||
wxTE_READONLY |
|
wxTE_READONLY |
|
||||||
@@ -248,12 +248,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
|||||||
// vBitmap.SetId(wxICON_TIP); // OS/2 specific bitmap method--OS/2 wxBitmaps all have an ID.
|
// vBitmap.SetId(wxICON_TIP); // OS/2 specific bitmap method--OS/2 wxBitmaps all have an ID.
|
||||||
// // and for StatBmp's under OS/2 it MUST be a valid resource ID.
|
// // and for StatBmp's under OS/2 it MUST be a valid resource ID.
|
||||||
//
|
//
|
||||||
// wxStaticBitmap* bmp = new wxStaticBitmap(this, -1, vBitmap);
|
// wxStaticBitmap* bmp = new wxStaticBitmap(this, wxID_ANY, vBitmap);
|
||||||
//
|
//
|
||||||
//#else
|
//#else
|
||||||
|
|
||||||
wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG);
|
wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG);
|
||||||
wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon);
|
wxStaticBitmap *bmp = new wxStaticBitmap(this, wxID_ANY, icon);
|
||||||
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -277,7 +277,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
|||||||
|
|
||||||
SetTipText();
|
SetTipText();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer( topsizer );
|
SetSizer( topsizer );
|
||||||
|
|
||||||
topsizer->SetSizeHints( this );
|
topsizer->SetSizeHints( this );
|
||||||
|
@@ -176,11 +176,11 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
|
|||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
m_Data = data;
|
m_Data = data;
|
||||||
m_DataCreated = FALSE;
|
m_DataCreated = false;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
m_Data = new wxHtmlHelpData();
|
m_Data = new wxHtmlHelpData();
|
||||||
m_DataCreated = TRUE;
|
m_DataCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ContentsBox = NULL;
|
m_ContentsBox = NULL;
|
||||||
@@ -208,7 +208,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
|
|||||||
m_Cfg.w = 700;
|
m_Cfg.w = 700;
|
||||||
m_Cfg.h = 480;
|
m_Cfg.h = 480;
|
||||||
m_Cfg.sashpos = 240;
|
m_Cfg.sashpos = 240;
|
||||||
m_Cfg.navig_on = TRUE;
|
m_Cfg.navig_on = true;
|
||||||
|
|
||||||
m_NormalFonts = m_FixedFonts = NULL;
|
m_NormalFonts = m_FixedFonts = NULL;
|
||||||
m_NormalFace = m_FixedFace = wxEmptyString;
|
m_NormalFace = m_FixedFace = wxEmptyString;
|
||||||
@@ -223,7 +223,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_PagesHash = NULL;
|
m_PagesHash = NULL;
|
||||||
m_UpdateContents = TRUE;
|
m_UpdateContents = true;
|
||||||
m_helpController = (wxHelpControllerBase*) NULL;
|
m_helpController = (wxHelpControllerBase*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,8 +251,8 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
if (m_Config)
|
if (m_Config)
|
||||||
ReadCustomization(m_Config, m_ConfigRoot);
|
ReadCustomization(m_Config, m_ConfigRoot);
|
||||||
|
|
||||||
wxFrame::Create(parent, id, _("Help"),
|
wxFrame::Create(parent, id, _("Help"),
|
||||||
wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h),
|
wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h),
|
||||||
wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp"));
|
wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp"));
|
||||||
|
|
||||||
GetPosition(&m_Cfg.x, &m_Cfg.y);
|
GetPosition(&m_Cfg.x, &m_Cfg.y);
|
||||||
@@ -304,15 +304,14 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
m_Splitter = new wxSplitterWindow(this);
|
m_Splitter = new wxSplitterWindow(this);
|
||||||
|
|
||||||
m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter);
|
m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter);
|
||||||
m_NavigPan = new wxPanel(m_Splitter, -1);
|
m_NavigPan = new wxPanel(m_Splitter, wxID_ANY);
|
||||||
m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
|
m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
|
||||||
wxDefaultPosition, wxDefaultSize);
|
wxDefaultPosition, wxDefaultSize);
|
||||||
wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook);
|
wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook);
|
||||||
|
|
||||||
navigSizer = new wxBoxSizer(wxVERTICAL);
|
navigSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
navigSizer->Add(nbs, 1, wxEXPAND);
|
navigSizer->Add(nbs, 1, wxEXPAND);
|
||||||
|
|
||||||
m_NavigPan->SetAutoLayout(TRUE);
|
|
||||||
m_NavigPan->SetSizer(navigSizer);
|
m_NavigPan->SetSizer(navigSizer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -330,17 +329,16 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
||||||
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
topsizer->Add(0, 10);
|
topsizer->Add(0, 10);
|
||||||
|
|
||||||
dummy->SetAutoLayout(TRUE);
|
|
||||||
dummy->SetSizer(topsizer);
|
dummy->SetSizer(topsizer);
|
||||||
|
|
||||||
if ( style & wxHF_BOOKMARKS )
|
if ( style & wxHF_BOOKMARKS )
|
||||||
{
|
{
|
||||||
m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST,
|
m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST,
|
||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0, NULL, wxCB_READONLY | wxCB_SORT);
|
0, NULL, wxCB_READONLY | wxCB_SORT);
|
||||||
m_Bookmarks->Append(_("(bookmarks)"));
|
m_Bookmarks->Append(_("(bookmarks)"));
|
||||||
for (unsigned i = 0; i < m_BookmarksNames.GetCount(); i++)
|
for (unsigned i = 0; i < m_BookmarksNames.GetCount(); i++)
|
||||||
@@ -348,11 +346,11 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
m_Bookmarks->SetSelection(0);
|
m_Bookmarks->SetSelection(0);
|
||||||
|
|
||||||
wxBitmapButton *bmpbt1, *bmpbt2;
|
wxBitmapButton *bmpbt1, *bmpbt2;
|
||||||
bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD,
|
bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD,
|
||||||
wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK,
|
wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK,
|
||||||
wxART_HELP_BROWSER));
|
wxART_HELP_BROWSER));
|
||||||
bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE,
|
bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE,
|
||||||
wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK,
|
wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK,
|
||||||
wxART_HELP_BROWSER));
|
wxART_HELP_BROWSER));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
bmpbt1->SetToolTip(_("Add current page to bookmarks"));
|
bmpbt1->SetToolTip(_("Add current page to bookmarks"));
|
||||||
@@ -360,22 +358,22 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
|
||||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
sizer->Add(m_Bookmarks, 1, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5);
|
sizer->Add(m_Bookmarks, 1, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5);
|
||||||
sizer->Add(bmpbt1, 0, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 2);
|
sizer->Add(bmpbt1, 0, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 2);
|
||||||
sizer->Add(bmpbt2, 0, wxALIGN_CENTRE_VERTICAL, 0);
|
sizer->Add(bmpbt2, 0, wxALIGN_CENTRE_VERTICAL, 0);
|
||||||
|
|
||||||
topsizer->Add(sizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 10);
|
topsizer->Add(sizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL,
|
m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxSUNKEN_BORDER |
|
wxSUNKEN_BORDER |
|
||||||
wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT |
|
wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT |
|
||||||
wxTR_LINES_AT_ROOT);
|
wxTR_LINES_AT_ROOT);
|
||||||
|
|
||||||
m_ContentsBox->AssignImageList(ContentsImageList);
|
m_ContentsBox->AssignImageList(ContentsImageList);
|
||||||
|
|
||||||
topsizer->Add(m_ContentsBox, 1,
|
topsizer->Add(m_ContentsBox, 1,
|
||||||
wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,
|
wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,
|
||||||
2);
|
2);
|
||||||
@@ -387,24 +385,23 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
// index listbox panel?
|
// index listbox panel?
|
||||||
if ( style & wxHF_INDEX )
|
if ( style & wxHF_INDEX )
|
||||||
{
|
{
|
||||||
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
||||||
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
dummy->SetAutoLayout(TRUE);
|
|
||||||
dummy->SetSizer(topsizer);
|
dummy->SetSizer(topsizer);
|
||||||
|
|
||||||
m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString,
|
m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxTE_PROCESS_ENTER);
|
wxTE_PROCESS_ENTER);
|
||||||
m_IndexButton = new wxButton(dummy, wxID_HTML_INDEXBUTTON, _("Find"));
|
m_IndexButton = new wxButton(dummy, wxID_HTML_INDEXBUTTON, _("Find"));
|
||||||
m_IndexButtonAll = new wxButton(dummy, wxID_HTML_INDEXBUTTONALL,
|
m_IndexButtonAll = new wxButton(dummy, wxID_HTML_INDEXBUTTONALL,
|
||||||
_("Show all"));
|
_("Show all"));
|
||||||
m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO,
|
m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO,
|
||||||
wxEmptyString, wxDefaultPosition,
|
wxEmptyString, wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
||||||
m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST,
|
m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0, NULL, wxLB_SINGLE);
|
0, NULL, wxLB_SINGLE);
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
@@ -416,7 +413,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
wxSizer *btsizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *btsizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btsizer->Add(m_IndexButton, 0, wxRIGHT, 2);
|
btsizer->Add(m_IndexButton, 0, wxRIGHT, 2);
|
||||||
btsizer->Add(m_IndexButtonAll);
|
btsizer->Add(m_IndexButtonAll);
|
||||||
topsizer->Add(btsizer, 0,
|
topsizer->Add(btsizer, 0,
|
||||||
wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
||||||
topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2);
|
topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2);
|
||||||
topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2);
|
topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2);
|
||||||
@@ -428,28 +425,27 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
// search list panel?
|
// search list panel?
|
||||||
if ( style & wxHF_SEARCH )
|
if ( style & wxHF_SEARCH )
|
||||||
{
|
{
|
||||||
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
|
||||||
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
dummy->SetAutoLayout(TRUE);
|
|
||||||
dummy->SetSizer(sizer);
|
dummy->SetSizer(sizer);
|
||||||
|
|
||||||
m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT,
|
m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT,
|
||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxTE_PROCESS_ENTER);
|
wxTE_PROCESS_ENTER);
|
||||||
m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
|
m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
|
||||||
wxDefaultPosition, wxDefaultSize);
|
wxDefaultPosition, wxDefaultSize);
|
||||||
m_SearchCaseSensitive = new wxCheckBox(dummy, -1, _("Case sensitive"));
|
m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive"));
|
||||||
m_SearchWholeWords = new wxCheckBox(dummy, -1, _("Whole words only"));
|
m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only"));
|
||||||
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
|
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above"));
|
m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above"));
|
||||||
#endif //wxUSE_TOOLTIPS
|
#endif //wxUSE_TOOLTIPS
|
||||||
m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST,
|
m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0, NULL, wxLB_SINGLE);
|
0, NULL, wxLB_SINGLE);
|
||||||
|
|
||||||
sizer->Add(m_SearchText, 0, wxEXPAND | wxALL, 10);
|
sizer->Add(m_SearchText, 0, wxEXPAND | wxALL, 10);
|
||||||
sizer->Add(m_SearchChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
sizer->Add(m_SearchChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
||||||
sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10);
|
sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10);
|
||||||
@@ -461,7 +457,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
m_SearchPage = notebook_page;
|
m_SearchPage = notebook_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_HtmlWin->Show(TRUE);
|
m_HtmlWin->Show();
|
||||||
|
|
||||||
RefreshLists();
|
RefreshLists();
|
||||||
|
|
||||||
@@ -480,24 +476,24 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
|||||||
|
|
||||||
if ( m_Cfg.navig_on )
|
if ( m_Cfg.navig_on )
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(TRUE);
|
m_NavigPan->Show();
|
||||||
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(FALSE);
|
m_NavigPan->Show(false);
|
||||||
m_Splitter->Initialize(m_HtmlWin);
|
m_Splitter->Initialize(m_HtmlWin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce flicker by updating the splitter pane sizes before the
|
// Reduce flicker by updating the splitter pane sizes before the
|
||||||
// frame is shown
|
// frame is shown
|
||||||
wxSizeEvent sizeEvent(GetSize(), GetId());
|
wxSizeEvent sizeEvent(GetSize(), GetId());
|
||||||
ProcessEvent(sizeEvent);
|
ProcessEvent(sizeEvent);
|
||||||
|
|
||||||
m_Splitter->UpdateSize();
|
m_Splitter->UpdateSize();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxHtmlHelpFrame::~wxHtmlHelpFrame()
|
wxHtmlHelpFrame::~wxHtmlHelpFrame()
|
||||||
@@ -507,7 +503,7 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame()
|
|||||||
delete m_Data;
|
delete m_Data;
|
||||||
if (m_NormalFonts) delete m_NormalFonts;
|
if (m_NormalFonts) delete m_NormalFonts;
|
||||||
if (m_FixedFonts) delete m_FixedFonts;
|
if (m_FixedFonts) delete m_FixedFonts;
|
||||||
if (m_PagesHash)
|
if (m_PagesHash)
|
||||||
{
|
{
|
||||||
WX_CLEAR_HASH_TABLE(*m_PagesHash);
|
WX_CLEAR_HASH_TABLE(*m_PagesHash);
|
||||||
delete m_PagesHash;
|
delete m_PagesHash;
|
||||||
@@ -521,23 +517,23 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame()
|
|||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
|
void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
|
||||||
{
|
{
|
||||||
wxBitmap wpanelBitmap =
|
wxBitmap wpanelBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_HELP_SIDE_PANEL, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_HELP_SIDE_PANEL, wxART_HELP_BROWSER);
|
||||||
wxBitmap wbackBitmap =
|
wxBitmap wbackBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_HELP_BROWSER);
|
||||||
wxBitmap wforwardBitmap =
|
wxBitmap wforwardBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_HELP_BROWSER);
|
||||||
wxBitmap wupnodeBitmap =
|
wxBitmap wupnodeBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_HELP_BROWSER);
|
||||||
wxBitmap wupBitmap =
|
wxBitmap wupBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_GO_UP, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_GO_UP, wxART_HELP_BROWSER);
|
||||||
wxBitmap wdownBitmap =
|
wxBitmap wdownBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_HELP_BROWSER);
|
||||||
wxBitmap wopenBitmap =
|
wxBitmap wopenBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_HELP_BROWSER);
|
||||||
wxBitmap wprintBitmap =
|
wxBitmap wprintBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_PRINT, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_PRINT, wxART_HELP_BROWSER);
|
||||||
wxBitmap woptionsBitmap =
|
wxBitmap woptionsBitmap =
|
||||||
wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_HELP_BROWSER);
|
wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_HELP_BROWSER);
|
||||||
|
|
||||||
wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() &&
|
wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() &&
|
||||||
@@ -549,26 +545,26 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
|
|||||||
|
|
||||||
|
|
||||||
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Show/hide navigation panel"));
|
_("Show/hide navigation panel"));
|
||||||
|
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Go back"));
|
_("Go back"));
|
||||||
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Go forward"));
|
_("Go forward"));
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
|
|
||||||
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Go one level up in document hierarchy"));
|
_("Go one level up in document hierarchy"));
|
||||||
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Previous page"));
|
_("Previous page"));
|
||||||
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Next page"));
|
_("Next page"));
|
||||||
|
|
||||||
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
|
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
|
||||||
@@ -576,19 +572,19 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
|
|||||||
|
|
||||||
if (style & wxHF_OPEN_FILES)
|
if (style & wxHF_OPEN_FILES)
|
||||||
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Open HTML document"));
|
_("Open HTML document"));
|
||||||
|
|
||||||
#if wxUSE_PRINTING_ARCHITECTURE
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
if (style & wxHF_PRINT)
|
if (style & wxHF_PRINT)
|
||||||
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Print this page"));
|
_("Print this page"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
|
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
|
||||||
FALSE, -1, -1, (wxObject *) NULL,
|
false, -1, -1, (wxObject *) NULL,
|
||||||
_("Display options dialog"));
|
_("Display options dialog"));
|
||||||
}
|
}
|
||||||
#endif //wxUSE_TOOLBAR
|
#endif //wxUSE_TOOLBAR
|
||||||
@@ -609,9 +605,10 @@ bool wxHtmlHelpFrame::Display(const wxString& x)
|
|||||||
{
|
{
|
||||||
m_HtmlWin->LoadPage(url);
|
m_HtmlWin->LoadPage(url);
|
||||||
NotifyPageChanged();
|
NotifyPageChanged();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxHtmlHelpFrame::Display(const int id)
|
bool wxHtmlHelpFrame::Display(const int id)
|
||||||
@@ -621,9 +618,10 @@ bool wxHtmlHelpFrame::Display(const int id)
|
|||||||
{
|
{
|
||||||
m_HtmlWin->LoadPage(url);
|
m_HtmlWin->LoadPage(url);
|
||||||
NotifyPageChanged();
|
NotifyPageChanged();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -631,22 +629,26 @@ bool wxHtmlHelpFrame::Display(const int id)
|
|||||||
bool wxHtmlHelpFrame::DisplayContents()
|
bool wxHtmlHelpFrame::DisplayContents()
|
||||||
{
|
{
|
||||||
if (! m_ContentsBox)
|
if (! m_ContentsBox)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!m_Splitter->IsSplit())
|
if (!m_Splitter->IsSplit())
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(TRUE);
|
m_NavigPan->Show();
|
||||||
m_HtmlWin->Show(TRUE);
|
m_HtmlWin->Show();
|
||||||
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
||||||
m_Cfg.navig_on = TRUE;
|
m_Cfg.navig_on = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_NavigNotebook->SetSelection(0);
|
m_NavigNotebook->SetSelection(0);
|
||||||
|
|
||||||
if (m_Data->GetBookRecArray().GetCount() > 0)
|
if (m_Data->GetBookRecArray().GetCount() > 0)
|
||||||
{
|
{
|
||||||
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
|
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
|
||||||
if (!book.GetStart().IsEmpty())
|
if (!book.GetStart().IsEmpty())
|
||||||
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
|
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -654,21 +656,25 @@ bool wxHtmlHelpFrame::DisplayContents()
|
|||||||
bool wxHtmlHelpFrame::DisplayIndex()
|
bool wxHtmlHelpFrame::DisplayIndex()
|
||||||
{
|
{
|
||||||
if (! m_IndexList)
|
if (! m_IndexList)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!m_Splitter->IsSplit())
|
if (!m_Splitter->IsSplit())
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(TRUE);
|
m_NavigPan->Show();
|
||||||
m_HtmlWin->Show(TRUE);
|
m_HtmlWin->Show();
|
||||||
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_NavigNotebook->SetSelection(1);
|
m_NavigNotebook->SetSelection(1);
|
||||||
|
|
||||||
if (m_Data->GetBookRecArray().GetCount() > 0)
|
if (m_Data->GetBookRecArray().GetCount() > 0)
|
||||||
{
|
{
|
||||||
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
|
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
|
||||||
if (!book.GetStart().IsEmpty())
|
if (!book.GetStart().IsEmpty())
|
||||||
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
|
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -695,8 +701,8 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
|
|||||||
|
|
||||||
if (!m_Splitter->IsSplit())
|
if (!m_Splitter->IsSplit())
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(TRUE);
|
m_NavigPan->Show();
|
||||||
m_HtmlWin->Show(TRUE);
|
m_HtmlWin->Show();
|
||||||
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,7 +711,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
|
|||||||
m_NavigNotebook->SetSelection(m_SearchPage);
|
m_NavigNotebook->SetSelection(m_SearchPage);
|
||||||
m_SearchList->Clear();
|
m_SearchList->Clear();
|
||||||
m_SearchText->SetValue(keyword);
|
m_SearchText->SetValue(keyword);
|
||||||
m_SearchButton->Enable(false);
|
m_SearchButton->Disable();
|
||||||
|
|
||||||
if (m_SearchChoice->GetSelection() != 0)
|
if (m_SearchChoice->GetSelection() != 0)
|
||||||
book = m_SearchChoice->GetStringSelection();
|
book = m_SearchChoice->GetStringSelection();
|
||||||
@@ -726,9 +732,9 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
|
|||||||
while (status.IsActive())
|
while (status.IsActive())
|
||||||
{
|
{
|
||||||
curi = status.GetCurIndex();
|
curi = status.GetCurIndex();
|
||||||
if (curi % 32 == 0
|
if (curi % 32 == 0
|
||||||
#if wxUSE_PROGRESSDLG
|
#if wxUSE_PROGRESSDLG
|
||||||
&& progress.Update(curi) == FALSE
|
&& !progress.Update(curi)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
break;
|
break;
|
||||||
@@ -742,7 +748,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_SearchButton->Enable(TRUE);
|
m_SearchButton->Enable();
|
||||||
m_SearchText->SetSelection(0, keyword.Length());
|
m_SearchText->SetSelection(0, keyword.Length());
|
||||||
m_SearchText->SetFocus();
|
m_SearchText->SetFocus();
|
||||||
}
|
}
|
||||||
@@ -750,14 +756,14 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
|
|||||||
{
|
{
|
||||||
m_NavigNotebook->SetSelection(m_IndexPage);
|
m_NavigNotebook->SetSelection(m_IndexPage);
|
||||||
m_IndexList->Clear();
|
m_IndexList->Clear();
|
||||||
m_IndexButton->Enable(false);
|
m_IndexButton->Disable();
|
||||||
m_IndexButtonAll->Enable(false);
|
m_IndexButtonAll->Disable();
|
||||||
m_IndexText->SetValue(keyword);
|
m_IndexText->SetValue(keyword);
|
||||||
|
|
||||||
wxCommandEvent dummy;
|
wxCommandEvent dummy;
|
||||||
OnIndexFind(dummy); // what a hack...
|
OnIndexFind(dummy); // what a hack...
|
||||||
m_IndexButton->Enable(true);
|
m_IndexButton->Enable();
|
||||||
m_IndexButtonAll->Enable(true);
|
m_IndexButtonAll->Enable();
|
||||||
foundcnt = m_IndexList->GetCount();
|
foundcnt = m_IndexList->GetCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,9 +822,9 @@ void wxHtmlHelpFrame::CreateContents()
|
|||||||
// set its icon accordingly
|
// set its icon accordingly
|
||||||
bool imaged[MAX_ROOTS];
|
bool imaged[MAX_ROOTS];
|
||||||
m_ContentsBox->DeleteAllItems();
|
m_ContentsBox->DeleteAllItems();
|
||||||
|
|
||||||
roots[0] = m_ContentsBox->AddRoot(_("(Help)"));
|
roots[0] = m_ContentsBox->AddRoot(_("(Help)"));
|
||||||
imaged[0] = TRUE;
|
imaged[0] = true;
|
||||||
|
|
||||||
for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++)
|
for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++)
|
||||||
{
|
{
|
||||||
@@ -837,9 +843,9 @@ void wxHtmlHelpFrame::CreateContents()
|
|||||||
roots[1] = m_ContentsBox->AppendItem(roots[0],
|
roots[1] = m_ContentsBox->AppendItem(roots[0],
|
||||||
it->m_Name, IMG_Book, -1,
|
it->m_Name, IMG_Book, -1,
|
||||||
new wxHtmlHelpTreeItemData(i));
|
new wxHtmlHelpTreeItemData(i));
|
||||||
m_ContentsBox->SetItemBold(roots[1], TRUE);
|
m_ContentsBox->SetItemBold(roots[1], true);
|
||||||
}
|
}
|
||||||
imaged[1] = TRUE;
|
imaged[1] = true;
|
||||||
}
|
}
|
||||||
// ...and their contents:
|
// ...and their contents:
|
||||||
else
|
else
|
||||||
@@ -847,7 +853,7 @@ void wxHtmlHelpFrame::CreateContents()
|
|||||||
roots[it->m_Level + 1] = m_ContentsBox->AppendItem(
|
roots[it->m_Level + 1] = m_ContentsBox->AppendItem(
|
||||||
roots[it->m_Level], it->m_Name, IMG_Page,
|
roots[it->m_Level], it->m_Name, IMG_Page,
|
||||||
-1, new wxHtmlHelpTreeItemData(i));
|
-1, new wxHtmlHelpTreeItemData(i));
|
||||||
imaged[it->m_Level + 1] = FALSE;
|
imaged[it->m_Level + 1] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_PagesHash->Put(it->GetFullPath(),
|
m_PagesHash->Put(it->GetFullPath(),
|
||||||
@@ -865,7 +871,7 @@ void wxHtmlHelpFrame::CreateContents()
|
|||||||
m_ContentsBox->SetItemImage(roots[it->m_Level], image);
|
m_ContentsBox->SetItemImage(roots[it->m_Level], image);
|
||||||
m_ContentsBox->SetItemImage(roots[it->m_Level], image,
|
m_ContentsBox->SetItemImage(roots[it->m_Level], image,
|
||||||
wxTreeItemIcon_Selected);
|
wxTreeItemIcon_Selected);
|
||||||
imaged[it->m_Level] = TRUE;
|
imaged[it->m_Level] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1047,32 +1053,32 @@ public:
|
|||||||
wxSpinCtrl *FontSize;
|
wxSpinCtrl *FontSize;
|
||||||
wxHtmlWindow *TestWin;
|
wxHtmlWindow *TestWin;
|
||||||
|
|
||||||
wxHtmlHelpFrameOptionsDialog(wxWindow *parent)
|
wxHtmlHelpFrameOptionsDialog(wxWindow *parent)
|
||||||
: wxDialog(parent, -1, wxString(_("Help Browser Options")))
|
: wxDialog(parent, wxID_ANY, wxString(_("Help Browser Options")))
|
||||||
{
|
{
|
||||||
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
||||||
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5);
|
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5);
|
||||||
|
|
||||||
sizer->Add(new wxStaticText(this, -1, _("Normal font:")));
|
sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:")));
|
||||||
sizer->Add(new wxStaticText(this, -1, _("Fixed font:")));
|
sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:")));
|
||||||
sizer->Add(new wxStaticText(this, -1, _("Font size:")));
|
sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:")));
|
||||||
|
|
||||||
sizer->Add(NormalFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition,
|
sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||||
wxSize(200, 200),
|
wxSize(200, 200),
|
||||||
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
|
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
|
||||||
|
|
||||||
sizer->Add(FixedFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition,
|
sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||||
wxSize(200, 200),
|
wxSize(200, 200),
|
||||||
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
|
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
|
||||||
|
|
||||||
sizer->Add(FontSize = new wxSpinCtrl(this, -1));
|
sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY));
|
||||||
FontSize->SetRange(2, 100);
|
FontSize->SetRange(2, 100);
|
||||||
|
|
||||||
topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);
|
topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);
|
||||||
|
|
||||||
topsizer->Add(new wxStaticText(this, -1, _("Preview:")),
|
topsizer->Add(new wxStaticText(this, wxID_ANY, _("Preview:")),
|
||||||
0, wxLEFT | wxTOP, 10);
|
0, wxLEFT | wxTOP, 10);
|
||||||
topsizer->Add(TestWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxSize(20, 150),
|
topsizer->Add(TestWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(20, 150),
|
||||||
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER),
|
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER),
|
||||||
1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10);
|
1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10);
|
||||||
|
|
||||||
@@ -1083,7 +1089,6 @@ public:
|
|||||||
sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10);
|
sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10);
|
||||||
topsizer->Add(sizer2, 0, wxALIGN_RIGHT);
|
topsizer->Add(sizer2, 0, wxALIGN_RIGHT);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(topsizer);
|
SetSizer(topsizer);
|
||||||
topsizer->Fit(this);
|
topsizer->Fit(this);
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
@@ -1137,8 +1142,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog)
|
BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog)
|
||||||
EVT_COMBOBOX(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate)
|
EVT_COMBOBOX(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdate)
|
||||||
EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
|
EVT_SPINCTRL(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
void wxHtmlHelpFrame::OptionsDialog()
|
void wxHtmlHelpFrame::OptionsDialog()
|
||||||
@@ -1157,24 +1162,24 @@ void wxHtmlHelpFrame::OptionsDialog()
|
|||||||
if (m_FixedFonts == NULL)
|
if (m_FixedFonts == NULL)
|
||||||
{
|
{
|
||||||
wxFontEnumerator enu;
|
wxFontEnumerator enu;
|
||||||
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE);
|
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, true /*enum fixed width only*/);
|
||||||
m_FixedFonts = new wxArrayString;
|
m_FixedFonts = new wxArrayString;
|
||||||
*m_FixedFonts = *enu.GetFacenames();
|
*m_FixedFonts = *enu.GetFacenames();
|
||||||
m_FixedFonts->Sort(wxStringSortAscending);
|
m_FixedFonts->Sort(wxStringSortAscending);
|
||||||
}
|
}
|
||||||
|
|
||||||
// VS: We want to show the font that is actually used by wxHtmlWindow.
|
// VS: We want to show the font that is actually used by wxHtmlWindow.
|
||||||
// If customization dialog wasn't used yet, facenames are empty and
|
// If customization dialog wasn't used yet, facenames are empty and
|
||||||
// wxHtmlWindow uses default fonts -- let's find out what they
|
// wxHtmlWindow uses default fonts -- let's find out what they
|
||||||
// are so that we can pass them to the dialog:
|
// are so that we can pass them to the dialog:
|
||||||
if (m_NormalFace.empty())
|
if (m_NormalFace.empty())
|
||||||
{
|
{
|
||||||
wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
|
wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false);
|
||||||
m_NormalFace = fnt.GetFaceName();
|
m_NormalFace = fnt.GetFaceName();
|
||||||
}
|
}
|
||||||
if (m_FixedFace.empty())
|
if (m_FixedFace.empty())
|
||||||
{
|
{
|
||||||
wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
|
wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false);
|
||||||
m_FixedFace = fnt.GetFaceName();
|
m_FixedFace = fnt.GetFaceName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1217,7 +1222,7 @@ void wxHtmlHelpFrame::NotifyPageChanged()
|
|||||||
if (ha)
|
if (ha)
|
||||||
{
|
{
|
||||||
bool olduc = m_UpdateContents;
|
bool olduc = m_UpdateContents;
|
||||||
m_UpdateContents = FALSE;
|
m_UpdateContents = false;
|
||||||
m_ContentsBox->SelectItem(ha->m_Id);
|
m_ContentsBox->SelectItem(ha->m_Id);
|
||||||
m_ContentsBox->EnsureVisible(ha->m_Id);
|
m_ContentsBox->EnsureVisible(ha->m_Id);
|
||||||
m_UpdateContents = olduc;
|
m_UpdateContents = olduc;
|
||||||
@@ -1345,14 +1350,14 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
m_Cfg.sashpos = m_Splitter->GetSashPosition();
|
m_Cfg.sashpos = m_Splitter->GetSashPosition();
|
||||||
m_Splitter->Unsplit(m_NavigPan);
|
m_Splitter->Unsplit(m_NavigPan);
|
||||||
m_Cfg.navig_on = FALSE;
|
m_Cfg.navig_on = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_NavigPan->Show(TRUE);
|
m_NavigPan->Show();
|
||||||
m_HtmlWin->Show(TRUE);
|
m_HtmlWin->Show();
|
||||||
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
|
||||||
m_Cfg.navig_on = TRUE;
|
m_Cfg.navig_on = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1458,10 +1463,10 @@ void wxHtmlHelpFrame::OnContentsSel(wxTreeEvent& event)
|
|||||||
if (pg && m_UpdateContents)
|
if (pg && m_UpdateContents)
|
||||||
{
|
{
|
||||||
it = m_Data->GetContents() + (pg->m_Id);
|
it = m_Data->GetContents() + (pg->m_Id);
|
||||||
m_UpdateContents = FALSE;
|
m_UpdateContents = false;
|
||||||
if (it->m_Page[0] != 0)
|
if (it->m_Page[0] != 0)
|
||||||
m_HtmlWin->LoadPage(it->GetFullPath());
|
m_HtmlWin->LoadPage(it->GetFullPath());
|
||||||
m_UpdateContents = TRUE;
|
m_UpdateContents = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1490,7 +1495,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
|
|||||||
const wxChar *cstr = sr.c_str();
|
const wxChar *cstr = sr.c_str();
|
||||||
wxChar mybuff[512];
|
wxChar mybuff[512];
|
||||||
wxChar *ptr;
|
wxChar *ptr;
|
||||||
bool first = TRUE;
|
bool first = true;
|
||||||
|
|
||||||
m_IndexList->Clear();
|
m_IndexList->Clear();
|
||||||
int cnt = m_Data->GetIndexCnt();
|
int cnt = m_Data->GetIndexCnt();
|
||||||
@@ -1513,7 +1518,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
|
|||||||
if (index[i].m_Page[0] != 0)
|
if (index[i].m_Page[0] != 0)
|
||||||
m_HtmlWin->LoadPage(index[i].GetFullPath());
|
m_HtmlWin->LoadPage(index[i].GetFullPath());
|
||||||
NotifyPageChanged();
|
NotifyPageChanged();
|
||||||
first = FALSE;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1533,7 +1538,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
m_IndexList->Clear();
|
m_IndexList->Clear();
|
||||||
int cnt = m_Data->GetIndexCnt();
|
int cnt = m_Data->GetIndexCnt();
|
||||||
bool first = TRUE;
|
bool first = true;
|
||||||
wxHtmlContentsItem* index = m_Data->GetIndex();
|
wxHtmlContentsItem* index = m_Data->GetIndex();
|
||||||
|
|
||||||
for (int i = 0; i < cnt; i++)
|
for (int i = 0; i < cnt; i++)
|
||||||
@@ -1544,7 +1549,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (index[i].m_Page[0] != 0)
|
if (index[i].m_Page[0] != 0)
|
||||||
m_HtmlWin->LoadPage(index[i].GetFullPath());
|
m_HtmlWin->LoadPage(index[i].GetFullPath());
|
||||||
NotifyPageChanged();
|
NotifyPageChanged();
|
||||||
first = FALSE;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1595,7 +1600,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
|
|||||||
RemoveGrab();
|
RemoveGrab();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_Splitter && m_Cfg.navig_on) m_Cfg.sashpos = m_Splitter->GetSashPosition();
|
if (m_Splitter && m_Cfg.navig_on) m_Cfg.sashpos = m_Splitter->GetSashPosition();
|
||||||
|
|
||||||
if (m_Config)
|
if (m_Config)
|
||||||
@@ -1612,7 +1617,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
|
void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)
|
void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)
|
||||||
|
@@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
|
|||||||
|
|
||||||
if (m_parentSizer == NULL) // setup window:
|
if (m_parentSizer == NULL) // setup window:
|
||||||
{
|
{
|
||||||
m_parentAsWindow->SetAutoLayout(true);
|
|
||||||
m_parentAsWindow->SetSizer(sizer);
|
m_parentAsWindow->SetSizer(sizer);
|
||||||
|
|
||||||
wxXmlNode *nd = m_node;
|
wxXmlNode *nd = m_node;
|
||||||
|
@@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child)
|
|||||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
SetAutoLayout(true);
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,14 +58,13 @@ ctConfigurationBrowserWindow::ctConfigurationBrowserWindow( wxWindow* parent, wx
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctConfigurationBrowserWindow::CreateControls()
|
void ctConfigurationBrowserWindow::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctConfigurationBrowserWindow content construction
|
////@begin ctConfigurationBrowserWindow content construction
|
||||||
|
|
||||||
ctConfigurationBrowserWindow* item1 = this;
|
ctConfigurationBrowserWindow* item1 = this;
|
||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxSplitterWindow* item3 = new wxSplitterWindow(item1, ID_CONFIGBROWSER_SPLITTERWINDOW, wxDefaultPosition, wxSize(400, 400), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE);
|
wxSplitterWindow* item3 = new wxSplitterWindow(item1, ID_CONFIGBROWSER_SPLITTERWINDOW, wxDefaultPosition, wxSize(400, 400), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE);
|
||||||
wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
|
wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
|
||||||
@@ -142,14 +141,13 @@ ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctConfigurationBrowserControlPanel::CreateControls()
|
void ctConfigurationBrowserControlPanel::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctConfigurationBrowserControlPanel content construction
|
////@begin ctConfigurationBrowserControlPanel content construction
|
||||||
|
|
||||||
ctConfigurationBrowserControlPanel* item5 = this;
|
ctConfigurationBrowserControlPanel* item5 = this;
|
||||||
|
|
||||||
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
|
||||||
item5->SetSizer(item6);
|
item5->SetSizer(item6);
|
||||||
item5->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
|
item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||||
@@ -170,7 +168,7 @@ void ctConfigurationBrowserControlPanel::CreateControls()
|
|||||||
wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
item6->Add(item13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
item6->Add(item13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||||
|
|
||||||
wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
|
wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
|
||||||
item6->Add(item14, 1, wxGROW|wxALL, 5);
|
item6->Add(item14, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
////@end ctConfigurationBrowserControlPanel content construction
|
////@end ctConfigurationBrowserControlPanel content construction
|
||||||
|
@@ -74,14 +74,13 @@ ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, c
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctConfigItemsSelector::CreateControls()
|
void ctConfigItemsSelector::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctConfigItemsSelector content construction
|
////@begin ctConfigItemsSelector content construction
|
||||||
|
|
||||||
ctConfigItemsSelector* item1 = this;
|
ctConfigItemsSelector* item1 = this;
|
||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
||||||
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
||||||
|
@@ -70,14 +70,13 @@ ctCustomPropertyDialog::ctCustomPropertyDialog( wxWindow* parent, wxWindowID id,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctCustomPropertyDialog::CreateControls()
|
void ctCustomPropertyDialog::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctCustomPropertyDialog content construction
|
////@begin ctCustomPropertyDialog content construction
|
||||||
|
|
||||||
ctCustomPropertyDialog* item1 = this;
|
ctCustomPropertyDialog* item1 = this;
|
||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
||||||
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
||||||
@@ -88,7 +87,7 @@ void ctCustomPropertyDialog::CreateControls()
|
|||||||
wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
||||||
|
|
||||||
wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, _(""), wxDefaultPosition, wxDefaultSize, 0);
|
wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
|
||||||
item3->Add(item6, 0, wxGROW|wxALL, 5);
|
item3->Add(item6, 0, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
@@ -148,7 +147,7 @@ void ctCustomPropertyDialog::CreateControls()
|
|||||||
wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
||||||
|
|
||||||
wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
|
wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
|
||||||
item3->Add(item20, 1, wxGROW|wxALL, 5);
|
item3->Add(item20, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
@@ -99,7 +99,6 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
|
|||||||
|
|
||||||
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
|
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
|
||||||
|
|
||||||
this->SetAutoLayout(true);
|
|
||||||
this->SetSizer( item0 );
|
this->SetSizer( item0 );
|
||||||
|
|
||||||
/// Add help text
|
/// Add help text
|
||||||
@@ -159,7 +158,7 @@ void ctPropertyEditor::ClearEditor()
|
|||||||
{
|
{
|
||||||
m_attributeEditorGrid->ClearAttributes();
|
m_attributeEditorGrid->ClearAttributes();
|
||||||
m_propertyDescriptionWindow->SetPage(WrapDescription(wxEmptyString));
|
m_propertyDescriptionWindow->SetPage(WrapDescription(wxEmptyString));
|
||||||
m_elementTitleTextCtrl->SetValue(_T(""));
|
m_elementTitleTextCtrl->SetValue(wxEmptyString);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handles detailed editing event.
|
/// Handles detailed editing event.
|
||||||
@@ -294,13 +293,13 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
|
|||||||
if (!m_item->CanEditProperty(prop->GetName()))
|
if (!m_item->CanEditProperty(prop->GetName()))
|
||||||
{
|
{
|
||||||
m_attributeEditorGrid->SetReadOnly(row, 1);
|
m_attributeEditorGrid->SetReadOnly(row, 1);
|
||||||
|
|
||||||
wxColour col(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
|
wxColour col(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
|
||||||
m_attributeEditorGrid->SetCellTextColour(row, 1, col);
|
m_attributeEditorGrid->SetCellTextColour(row, 1, col);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_attributeEditorGrid->SetReadOnly(row, 1, false);
|
m_attributeEditorGrid->SetReadOnly(row, 1, false);
|
||||||
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
|
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +345,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
|
|||||||
m_attributeEditorGrid->SetCellEditor(row, 1,
|
m_attributeEditorGrid->SetCellEditor(row, 1,
|
||||||
new ctGridCellTextEditor);
|
new ctGridCellTextEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +410,7 @@ ctProperty* ctPropertyEditor::FindSelectedProperty(int& row)
|
|||||||
if (selRow > -1)
|
if (selRow > -1)
|
||||||
{
|
{
|
||||||
row = selRow;
|
row = selRow;
|
||||||
|
|
||||||
if (selRow < (int) m_item->GetProperties().GetCount())
|
if (selRow < (int) m_item->GetProperties().GetCount())
|
||||||
{
|
{
|
||||||
ctProperty* prop = m_item->GetProperties().GetNth(selRow);
|
ctProperty* prop = m_item->GetProperties().GetNth(selRow);
|
||||||
@@ -536,7 +535,7 @@ void ctPropertyEditor::UpdateDescription(int row)
|
|||||||
}
|
}
|
||||||
if (row == -1)
|
if (row == -1)
|
||||||
{
|
{
|
||||||
wxString str = WrapDescription(wxEmptyString);
|
wxString str = WrapDescription(wxEmptyString);
|
||||||
m_propertyDescriptionWindow->SetPage(str);
|
m_propertyDescriptionWindow->SetPage(str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -544,7 +543,7 @@ void ctPropertyEditor::UpdateDescription(int row)
|
|||||||
ctProperty* prop = FindProperty(row);
|
ctProperty* prop = FindProperty(row);
|
||||||
if (prop)
|
if (prop)
|
||||||
{
|
{
|
||||||
wxString str = WrapDescription(m_item->GetDescription(prop));
|
wxString str = WrapDescription(m_item->GetDescription(prop));
|
||||||
m_propertyDescriptionWindow->SetPage(str);
|
m_propertyDescriptionWindow->SetPage(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -557,13 +556,13 @@ wxString ctPropertyEditor::WrapDescription(const wxString& s)
|
|||||||
wxColour col = ctDESCRIPTION_BACKGROUND_COLOUR;
|
wxColour col = ctDESCRIPTION_BACKGROUND_COLOUR;
|
||||||
wxString colStr = apColourToHexString(col);
|
wxString colStr = apColourToHexString(col);
|
||||||
colStr = wxT("#") + colStr;
|
colStr = wxT("#") + colStr;
|
||||||
|
|
||||||
wxString str;
|
wxString str;
|
||||||
str << _T("<HTML><BODY BGCOLOR=\"") << colStr << wxT("\"><FONT SIZE=-1>") ;
|
str << _T("<HTML><BODY BGCOLOR=\"") << colStr << wxT("\"><FONT SIZE=-1>") ;
|
||||||
str << s;
|
str << s;
|
||||||
str << _T("</FONT></BODY></HTML>");
|
str << _T("</FONT></BODY></HTML>");
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Intercept cell data change event.
|
/// Intercept cell data change event.
|
||||||
@@ -655,13 +654,13 @@ void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* proper
|
|||||||
|
|
||||||
// Apply the new value
|
// Apply the new value
|
||||||
property->GetVariant() = variant;
|
property->GetVariant() = variant;
|
||||||
item->ApplyProperty(property, oldValue);
|
item->ApplyProperty(property, oldValue);
|
||||||
item->Modify();
|
item->Modify();
|
||||||
|
|
||||||
UpdateItem();
|
UpdateItem();
|
||||||
|
|
||||||
wxString menuLabel(_T("Change ") + property->GetName());
|
wxString menuLabel(_T("Change ") + property->GetName());
|
||||||
|
|
||||||
// This won't do anything first time Do is applied,
|
// This won't do anything first time Do is applied,
|
||||||
// since we've already done the action for this property.
|
// since we've already done the action for this property.
|
||||||
// But when we Undo or Redo, the changed properties will be applied.
|
// But when we Undo or Redo, the changed properties will be applied.
|
||||||
@@ -791,7 +790,7 @@ ctMultiLineTextEditor::ctMultiLineTextEditor( wxWindow *parent, wxWindowID id, c
|
|||||||
AddControls(this, msg);
|
AddControls(this, msg);
|
||||||
Centre();
|
Centre();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
||||||
{
|
{
|
||||||
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
|
||||||
@@ -801,7 +800,7 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
|||||||
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
|
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT, 5 );
|
item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT, 5 );
|
||||||
|
|
||||||
wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH );
|
wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH );
|
||||||
item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
|
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
|
||||||
@@ -826,7 +825,6 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
|||||||
item3->SetFocus();
|
item3->SetFocus();
|
||||||
((wxButton*) FindWindow(wxID_OK))->SetDefault();
|
((wxButton*) FindWindow(wxID_OK))->SetDefault();
|
||||||
|
|
||||||
parent->SetAutoLayout( true );
|
|
||||||
parent->SetSizer(item0);
|
parent->SetSizer(item0);
|
||||||
item0->Fit(parent);
|
item0->Fit(parent);
|
||||||
|
|
||||||
|
@@ -69,14 +69,13 @@ ctSettingsDialog::ctSettingsDialog( wxWindow* parent, wxWindowID id, const wxStr
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctSettingsDialog::CreateControls()
|
void ctSettingsDialog::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctSettingsDialog content construction
|
////@begin ctSettingsDialog content construction
|
||||||
|
|
||||||
ctSettingsDialog* item1 = this;
|
ctSettingsDialog* item1 = this;
|
||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
|
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
|
||||||
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
|
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
|
||||||
@@ -204,14 +203,13 @@ ctGeneralSettingsDialog::ctGeneralSettingsDialog( wxWindow* parent, wxWindowID i
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctGeneralSettingsDialog::CreateControls()
|
void ctGeneralSettingsDialog::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctGeneralSettingsDialog content construction
|
////@begin ctGeneralSettingsDialog content construction
|
||||||
|
|
||||||
ctGeneralSettingsDialog* item4 = this;
|
ctGeneralSettingsDialog* item4 = this;
|
||||||
|
|
||||||
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
|
||||||
item4->SetSizer(item5);
|
item4->SetSizer(item5);
|
||||||
item4->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings"));
|
wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings"));
|
||||||
wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL);
|
wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL);
|
||||||
@@ -306,14 +304,13 @@ ctLocationSettingsDialog::ctLocationSettingsDialog( wxWindow* parent, wxWindowID
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ctLocationSettingsDialog::CreateControls()
|
void ctLocationSettingsDialog::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin ctLocationSettingsDialog content construction
|
////@begin ctLocationSettingsDialog content construction
|
||||||
|
|
||||||
ctLocationSettingsDialog* item11 = this;
|
ctLocationSettingsDialog* item11 = this;
|
||||||
|
|
||||||
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
|
||||||
item11->SetSizer(item12);
|
item11->SetSizer(item12);
|
||||||
item11->SetAutoLayout(true);
|
|
||||||
|
|
||||||
wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations"));
|
wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations"));
|
||||||
wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL);
|
wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL);
|
||||||
@@ -325,7 +322,7 @@ void ctLocationSettingsDialog::CreateControls()
|
|||||||
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
item13->Add(item15, 0, wxGROW, 5);
|
item13->Add(item15, 0, wxGROW, 5);
|
||||||
|
|
||||||
wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, _(""), wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0);
|
wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, wxEmptyString, wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0);
|
||||||
item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
|
item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (ShowToolTips())
|
if (ShowToolTips())
|
||||||
|
@@ -182,7 +182,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title)
|
|||||||
// Make a panel
|
// Make a panel
|
||||||
m_panel = new wxPanel(this );
|
m_panel = new wxPanel(this );
|
||||||
|
|
||||||
m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog",
|
m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog",
|
||||||
wxPoint(10,10), wxDefaultSize );
|
wxPoint(10,10), wxDefaultSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
|
|||||||
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->SetSizeHints(this);
|
sizerTop->SetSizeHints(this);
|
||||||
|
@@ -35,7 +35,7 @@ wxDllWidget::wxDllWidget(wxWindow *parent,
|
|||||||
long style)
|
long style)
|
||||||
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
|
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||||
className + wxT("_container")),
|
className + wxT("_container")),
|
||||||
m_widget(NULL), m_lib(NULL), m_controlAdded(FALSE)
|
m_widget(NULL), m_lib(NULL), m_controlAdded(false)
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxColour(255, 0, 255));
|
SetBackgroundColour(wxColour(255, 0, 255));
|
||||||
if ( !!className )
|
if ( !!className )
|
||||||
@@ -53,11 +53,10 @@ void wxDllWidget::AddChild(wxWindowBase *child)
|
|||||||
|
|
||||||
wxPanel::AddChild(child);
|
wxPanel::AddChild(child);
|
||||||
|
|
||||||
m_controlAdded = TRUE;
|
m_controlAdded = true;
|
||||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
sizer->Add((wxWindow*)child, 1, wxEXPAND);
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
|
|||||||
{
|
{
|
||||||
delete m_lib;
|
delete m_lib;
|
||||||
m_lib = NULL;
|
m_lib = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLL_WidgetFactory_t factory;
|
DLL_WidgetFactory_t factory;
|
||||||
@@ -94,7 +93,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
|
|||||||
{
|
{
|
||||||
delete m_lib;
|
delete m_lib;
|
||||||
m_lib = NULL;
|
m_lib = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
|
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
|
||||||
@@ -103,10 +102,10 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
|
|||||||
delete m_lib;
|
delete m_lib;
|
||||||
m_lib = NULL;
|
m_lib = NULL;
|
||||||
m_widget = NULL;
|
m_widget = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDllWidget::UnloadWidget()
|
void wxDllWidget::UnloadWidget()
|
||||||
|
@@ -41,7 +41,7 @@ Example of use:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyWindow(wxWindow *parent, long style)
|
MyWindow(wxWindow *parent, long style)
|
||||||
: wxWindow(parent, -1) {}
|
: wxWindow(parent, wxID_ANY) {}
|
||||||
|
|
||||||
int HandleCommand(int cmd, const wxString& param)
|
int HandleCommand(int cmd, const wxString& param)
|
||||||
{
|
{
|
||||||
@@ -75,7 +75,7 @@ class wxDllWidget : public wxPanel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDllWidget(wxWindow *parent,
|
wxDllWidget(wxWindow *parent,
|
||||||
wxWindowID id = -1,
|
wxWindowID id = wxID_ANY,
|
||||||
const wxString& dllName = wxEmptyString,
|
const wxString& dllName = wxEmptyString,
|
||||||
const wxString& className = wxEmptyString,
|
const wxString& className = wxEmptyString,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
@@ -132,12 +132,12 @@ private:
|
|||||||
{ \
|
{ \
|
||||||
*classInst = new widget(parent, style); \
|
*classInst = new widget(parent, style); \
|
||||||
*cmdFunc = SendCommandTo##widget; \
|
*cmdFunc = SendCommandTo##widget; \
|
||||||
return TRUE; \
|
return true; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define END_WIDGET_LIBRARY() \
|
#define END_WIDGET_LIBRARY() \
|
||||||
return FALSE; \
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __DLLWIDGET_H__
|
#endif // __DLLWIDGET_H__
|
||||||
|
@@ -9,7 +9,7 @@ class TestWindow : public wxWindow
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestWindow(wxWindow *parent, long style)
|
TestWindow(wxWindow *parent, long style)
|
||||||
: wxWindow(parent, -1)
|
: wxWindow(parent, wxID_ANY)
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxColour("white"));
|
SetBackgroundColour(wxColour("white"));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user