m_mainFrame->Show(true);
SetTopWindow(m_mainFrame);
-
+
return true;
}
panel->SetConstraints(c);
}
#endif
-
+
// Add items to the panel
wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxDefaultPosition,
wxSize(80, 26), 0, wxDefaultValidator, _T("ok"));
okButton->SetConstraints(c);
// 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"));
c = new wxLayoutConstraints;
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
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)),
1, wxEXPAND|wxALL, 10);
-
+
sizer->Add(5,5);
- wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
+ wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
wxDefaultPosition,wxSize(300,200));
wxArrayString ar;
ar.Add(_T("*.cpp"));
sizer->Add(lb, 1, wxEXPAND|wxALL, 10);
sizer->Add(5,5);
-
+
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
- dlg.SetAutoLayout(true);
dlg.SetSizer(sizer);
sizer->Fit(&dlg);
dlg.Centre();
-
+
dlg.ShowModal();
wxString res = _("'Except' contains these strings:\n\n");
for (size_t i = 0; i < ar.GetCount(); i++)
res << ar[i] << _T("\n");
wxMessageBox(res);
-
+
return false;
}
MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
// dtor
~MMBoardFrame();
-
+
// event handlers
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnEject(wxCommandEvent& event);
void OnRefreshInfo(wxEvent& event);
void OnSetPosition(wxCommandEvent& event);
-
+
void OpenVideoWindow();
void CloseVideoWindow();
-
+
private:
// any class wishing to process wxWidgets events must use this macro
DECLARE_EVENT_TABLE()
private:
- void UpdateMMedInfo();
+ void UpdateMMedInfo();
void UpdateInfoText();
-
+
MMBoardFile *m_opened_file;
-
+
wxSlider *m_positionSlider;
wxBitmapButton *m_playButton, *m_pauseButton, *m_stopButton, *m_ejectButton;
wxStaticText *m_fileType, *m_infoText;
wxWindow *m_video_window;
-
+
wxPanel *m_panel;
wxSizer *m_sizer;
-
+
wxTimer *m_refreshTimer;
};
EVT_BUTTON(MMBoard_PlayButton, MMBoardFrame::OnPlay)
EVT_BUTTON(MMBoard_StopButton, MMBoardFrame::OnStop)
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_CUSTOM(wxEVT_TIMER, MMBoard_RefreshInfo, MMBoardFrame::OnRefreshInfo)
END_EVENT_TABLE()
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
- frame->Show(TRUE);
+ frame->Show();
m_caps = TestMultimediaCaps();
if (!m_caps) {
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;
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_WIN) ? _T("WIN") : _T(""));
+ (m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""),
+ (m_caps & MM_SOUND_WIN) ? _T("WIN") : _T(""));
wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL);
// 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.
- return TRUE;
+ return true;
}
wxUint8 MMBoardApp::TestMultimediaCaps()
{
wxSoundStream *dev;
wxUint8 caps;
-
+
caps = 0;
-
+
#ifdef __UNIX__
// We now test the ESD support
-
+
dev = new wxSoundStreamESD();
- if (dev->GetError() == wxSOUND_NOERROR)
+ if (dev->GetError() == wxSOUND_NOERROR)
caps |= MM_SOUND_ESD;
delete dev;
-
+
// We test the OSS (Open Sound System) support.
// 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.
#endif
#endif
-
+
#ifdef __WIN32__
// We test the Windows sound support.
caps |= MM_SOUND_WIN;
delete dev;
#endif
-
+
return caps;
}
// frame constructor
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__
// we need this in order to allow the about menu relocation, since ABOUT is
SetIcon(wxICON(mondrian));
// 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
wxMenu *helpMenu = new wxMenu;
// Misc variables
m_opened_file = NULL;
- m_panel = new wxPanel(this, -1);
+ m_panel = new wxPanel(this, wxID_ANY);
// Initialize main slider
m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60,
- wxDefaultPosition, wxSize(300, -1),
- wxSL_HORIZONTAL | wxSL_AUTOTICKS);
+ wxDefaultPosition, wxSize(300, -1),
+ wxSL_HORIZONTAL | wxSL_AUTOTICKS);
m_positionSlider->SetPageSize(60); // 60 secs
- m_positionSlider->Enable(FALSE);
-
+ m_positionSlider->Disable();
+
// Initialize info panel
- wxPanel *infoPanel = new wxPanel( m_panel, -1);
+ wxPanel *infoPanel = new wxPanel( m_panel, wxID_ANY);
infoPanel->SetBackgroundColour(*wxBLACK);
infoPanel->SetForegroundColour(*wxWHITE);
wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL);
- m_fileType = new wxStaticText(infoPanel, -1, wxT(""));
- wxStaticLine *line = new wxStaticLine(infoPanel, -1);
- m_infoText = new wxStaticText(infoPanel, -1, _T(""));
+ m_fileType = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
+ wxStaticLine *line = new wxStaticLine(infoPanel, wxID_ANY);
+ m_infoText = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
UpdateInfoText();
infoSizer->Add(m_fileType, 0, wxGROW | wxALL, 1);
infoSizer->Add(line, 0, wxGROW | wxCENTRE, 20);
infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1);
-
+
infoPanel->SetSizer(infoSizer);
- infoPanel->SetAutoLayout(TRUE);
// Bitmap button panel
wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
-
+
wxBitmap play_bmp(play_back_xpm);
wxBitmap stop_bmp(stop_back_xpm);
wxBitmap eject_bmp(eject_xpm);
wxBitmap pause_bmp(pause_xpm);
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->Enable(FALSE);
+ m_pauseButton->Disable();
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->Enable(FALSE);
-
+ m_ejectButton->Disable();
+
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_ejectButton, 0, wxALL, 2);
// Top sizer
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(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(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_panel->SetSizer(m_sizer);
- m_panel->SetAutoLayout(TRUE);
m_sizer->Fit(this);
m_sizer->SetSizeHints(this);
{
if (m_opened_file)
delete m_opened_file;
-
+
delete m_refreshTimer;
}
if (m_video_window)
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_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1);
void MMBoardFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
wxString msg;
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("Copyright 1999, 2000, Guilhem Lavaux.\n"));
-
+ wxT("Copyright 1999, 2000, Guilhem Lavaux.\n"));
+
wxMessageBox(msg, _T("About MMBoard"), wxOK | wxICON_INFORMATION, this);
}
void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
wxString selected_file;
-
+
if (m_opened_file) {
if (!m_opened_file->IsStopped()) {
wxCommandEvent event2;
}
delete m_opened_file;
}
-
+
// select a file to be opened
selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this);
if (selected_file.IsNull())
return;
-
+
m_opened_file = MMBoardManager::Open(selected_file);
-
+
// Change the range values of the slider.
MMBoardTime length;
-
+
length = m_opened_file->GetLength();
m_positionSlider->SetRange(0, length.hours * 3600 + length.minutes * 60 + length.seconds);
-
+
// Update misc info
UpdateMMedInfo();
-
+
SetStatusText(selected_file, 2);
-
+
// Update info text
UpdateInfoText();
-
+
// Enable a few buttons
- m_playButton->Enable(TRUE);
- m_ejectButton->Enable(TRUE);
- m_positionSlider->Enable(TRUE);
-
+ m_playButton->Enable();
+ m_ejectButton->Enable();
+ m_positionSlider->Enable();
+
if (m_opened_file->NeedWindow()) {
OpenVideoWindow();
m_opened_file->SetWindow(m_video_window);
void MMBoardFrame::UpdateInfoText()
{
wxString infotext1, infotext2;
-
+
if (m_opened_file) {
infotext1 = wxT("File type:\n\t");
infotext1 += m_opened_file->GetStringType() + wxT("\n");
-
+
infotext2 = wxT("File informations:\n\n");
infotext2 += m_opened_file->GetStringInformation();
} else {
infotext1 = wxT("File type: \n\tNo file opened");
infotext2 = wxT("File informations:\nNo information\n\n\n\n\n");
}
-
+
m_fileType->SetLabel(infotext1);
m_infoText->SetLabel(infotext2);
}
{
wxString temp_string;
MMBoardTime current, length;
-
+
if (m_opened_file) {
current = m_opened_file->GetPosition();
length = m_opened_file->GetLength();
temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes,
current.seconds, length.hours * 60 + length.minutes, length.seconds);
SetStatusText(temp_string, 1);
-
+
// We set the slider position
m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds);
}
void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
{
UpdateMMedInfo();
-
- if (m_opened_file->IsStopped()) {
+
+ if (m_opened_file->IsStopped())
+ {
m_refreshTimer->Stop();
- m_playButton->Enable(TRUE);
- m_stopButton->Enable(FALSE);
- m_pauseButton->Enable(FALSE);
+ m_playButton->Enable();
+ m_stopButton->Disable();
+ m_pauseButton->Disable();
}
}
void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
{
- m_stopButton->Enable(TRUE);
- m_pauseButton->Enable(TRUE);
- m_playButton->Enable(FALSE);
-
- if (m_opened_file->IsPaused()) {
+ m_stopButton->Enable();
+ m_pauseButton->Enable();
+ m_playButton->Disable();
+
+ if (m_opened_file->IsPaused())
+ {
m_opened_file->Resume();
return;
}
-
- m_refreshTimer->Start(1000, FALSE);
-
+
+ m_refreshTimer->Start(1000, false);
+
m_opened_file->Play();
-
- m_stopButton->Enable(TRUE);
- m_pauseButton->Enable(TRUE);
- m_playButton->Enable(FALSE);
+
+ m_stopButton->Enable();
+ m_pauseButton->Enable();
+ m_playButton->Disable();
}
void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
m_opened_file->Stop();
m_refreshTimer->Stop();
- m_stopButton->Enable(FALSE);
- m_playButton->Enable(TRUE);
-
+ m_stopButton->Disable();
+ m_playButton->Enable();
+
UpdateMMedInfo();
}
void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event))
{
m_opened_file->Pause();
-
- m_playButton->Enable(TRUE);
- m_pauseButton->Enable(FALSE);
+
+ m_playButton->Enable();
+ m_pauseButton->Disable();
}
void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
delete m_opened_file;
m_opened_file = NULL;
-
- m_playButton->Enable(FALSE);
- m_pauseButton->Enable(FALSE);
- m_stopButton->Enable(FALSE);
- m_ejectButton->Enable(FALSE);
- m_positionSlider->Enable(FALSE);
+
+ m_playButton->Disable();
+ m_pauseButton->Disable();
+ m_stopButton->Disable();
+ m_ejectButton->Disable();
+ m_positionSlider->Disable();
UpdateInfoText();
UpdateMMedInfo();
{
wxUint32 itime;
MMBoardTime btime;
-
+
itime = m_positionSlider->GetValue();
btime.seconds = itime % 60;
btime.minutes = (itime / 60) % 60;
if (!m_propertySheet)
return;
- if (win.GetName() == wxT(""))
+ if (win.GetName().empty())
return;
if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
if (clearEditArea)
{
m_valueList->Clear();
- m_valueText->SetValue( wxT("") );
+ m_valueText->SetValue(wxEmptyString);
}
wxNode *node = m_propertySheet->GetProperties().GetFirst();
}
m_valueList->Clear();
- m_valueText->SetValue( wxT("") );
+ m_valueText->SetValue(wxEmptyString);
if (property)
{
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);
- m_valueText->Enable(false);
+ m_valueText->Disable();
topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
if (m_buttonFlags & wxPROP_PULLDOWN)
{
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 );
}
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
wxString s(view->GetValueList()->GetStringSelection());
- if (s != wxT(""))
+ if ( !s.empty() )
{
view->GetValueText()->SetValue(s);
view->RetrieveProperty(property);
bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(false);
+ view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(false);
+ view->GetCancelButton()->Disable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(false);
+ view->GetEditButton()->Disable();
return true;
}
bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(true);
+ view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(true);
+ view->GetCancelButton()->Enable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(false);
+ view->GetEditButton()->Disable();
if (view->GetValueText())
- view->GetValueText()->Enable(true);
+ view->GetValueText()->Enable();
return true;
}
bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(true);
+ view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(true);
+ view->GetCancelButton()->Enable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(false);
+ view->GetEditButton()->Disable();
if (view->GetValueText())
- view->GetValueText()->Enable(true);
+ view->GetValueText()->Enable();
return true;
}
bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(false);
+ view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(false);
+ view->GetCancelButton()->Disable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(true);
+ view->GetEditButton()->Enable();
if (view->GetValueText())
- view->GetValueText()->Enable(false);
+ view->GetValueText()->Disable();
return true;
}
if (view->GetValueList())
{
view->ShowListBoxControl(true);
- view->GetValueList()->Enable(true);
+ view->GetValueList()->Enable();
view->GetValueList()->Append(wxT("True"));
view->GetValueList()->Append(wxT("False"));
{
view->GetValueList()->Clear();
view->ShowListBoxControl(false);
- view->GetValueList()->Enable(false);
+ view->GetValueList()->Disable();
}
return true;
}
if (!m_strings)
{
if (view->GetEditButton())
- view->GetEditButton()->Enable(false);
+ view->GetEditButton()->Disable();
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(true);
+ view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(true);
+ view->GetCancelButton()->Enable();
if (view->GetValueText())
- view->GetValueText()->Enable(true);
+ view->GetValueText()->Enable();
return true;
}
// Constrained
if (view->GetValueText())
- view->GetValueText()->Enable(false);
+ view->GetValueText()->Disable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(true);
+ view->GetEditButton()->Enable();
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(false);
+ view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(false);
+ view->GetCancelButton()->Disable();
return true;
}
if (view->GetValueList())
{
view->ShowListBoxControl(true);
- view->GetValueList()->Enable(true);
+ view->GetValueList()->Enable();
wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
{
view->GetValueList()->Clear();
view->ShowListBoxControl(false);
- view->GetValueList()->Enable(false);
+ view->GetValueList()->Disable();
}
return true;
}
bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(true);
+ view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(true);
+ view->GetCancelButton()->Enable();
if (view->GetEditButton())
- view->GetEditButton()->Enable(true);
+ view->GetEditButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
return true;
m_filenameWildCard.GetData(),
0,
parentWindow);
- if (s != wxT(""))
+ if ( !s.empty() )
{
property->GetValue() = s;
view->DisplayProperty(property);
bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
- if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(true);
- if (view->GetCancelButton())
- view->GetCancelButton()->Enable(true);
- if (view->GetEditButton())
- view->GetEditButton()->Enable(true);
- if (view->GetValueText())
- view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
- return true;
+ if (view->GetConfirmButton())
+ view->GetConfirmButton()->Enable();
+
+ if (view->GetCancelButton())
+ view->GetCancelButton()->Enable();
+
+ if (view->GetEditButton())
+ view->GetEditButton()->Enable();
+
+ 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)
bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetEditButton())
- view->GetEditButton()->Enable(true);
+ view->GetEditButton()->Enable();
if (view->GetValueText())
- view->GetValueText()->Enable(false);
+ view->GetValueText()->Disable();
if (view->GetConfirmButton())
- view->GetConfirmButton()->Enable(false);
+ view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
- view->GetCancelButton()->Enable(false);
+ view->GetCancelButton()->Disable();
return true;
}
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE);
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);
- 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 *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
#endif
wxBoxSizer *m_bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
- m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 );
- m_bottom_sizer->Add(deleteButton, 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(1, 1, 1, wxEXPAND | wxALL);
- m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 );
- m_bottom_sizer->Add(okButton, 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 );
wxBoxSizer *m_sizer = new wxBoxSizer( wxVERTICAL );
- 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_listBox, 1, wxEXPAND | wxALL, 2 );
+ m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 );
m_sizer->Add(m_bottom_sizer, 0, wxEXPAND | wxALL , 0 );
dialog->SetSizer( m_sizer );
delete[] (wxChar *)node->GetData();
delete node;
m_currentSelection = -1;
- m_stringText->SetValue(_T(""));
+ m_stringText->SetValue(wxEmptyString);
}
void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
{
if (m_currentSelection == -1)
{
- m_stringText->SetValue(wxT(""));
+ m_stringText->SetValue(wxEmptyString);
return;
}
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
wxChar *txt = (wxChar *)node->GetData();
m_stringText->SetValue(txt);
- m_stringText->Enable(true);
+ m_stringText->Enable();
}
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name)
{
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);
m_bDown->SetToolTip(_("Move down"));
#endif
- subp->SetAutoLayout(true);
subp->SetSizer(subsizer);
subsizer->Fit(subp);
sizer->Add(m_listCtrl, 1, wxEXPAND);
- SetAutoLayout(true);
SetSizer(sizer);
Layout();
}
for (i = 0; i < strings.GetCount(); 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);
}
void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
{
- if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
+ if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 &&
!event.GetText().IsEmpty() )
{
// 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
// possible:
- m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T(""));
+ m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString);
}
}
if (m_parentSizer == NULL) // setup window:
{
- m_parentAsWindow->SetAutoLayout(true);
m_parentAsWindow->SetSizer(sizer);
wxXmlNode *nd = m_node;
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
- SetAutoLayout(true);
Layout();
}
m_TreeCtrl->AssignImageList(imgList);
sizer->Add(m_TreeCtrl, 1, wxEXPAND);
- SetAutoLayout(true);
SetSizer(sizer);
// Load file:
case ID_OPEN :
{
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);
if (!name.IsEmpty())
LoadFile(name);
case ID_SAVEAS :
{
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);
if (!name.IsEmpty())
SaveFile((m_FileName = name));
wxWindow* PropEditCtrlFont::CreateEditCtrl()
{
PropEditCtrlTxt::CreateEditCtrl();
- m_TextCtrl->Enable(false);
+ m_TextCtrl->Disable();
return m_TextCtrl;
}
sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
dlg.SetSizer(sz);
- dlg.SetAutoLayout(true);
dlg.Layout();
for (i = 0; i < arr.GetCount(); i++)
wxString name = wxFileSelector(_("Choose file"),
wxPathOnly(txt),
wxFileNameFromPath(txt),
- _T(""),
+ wxEmptyString,
GetFileTypes(),
wxOPEN | wxFILE_MUST_EXIST);
if (!name) return;
if (HasClearButton())
sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition,
wxSize(16,wxDefaultSize.y)));
- SetAutoLayout(true);
SetSizer(sz);
m_Created = true;
}
wxDialog(parent, ID_DIALOG_DSN, title)
{
int chSize; // Height of Font * 1.4 = Height of wxTextCtrl
-
+
float ratio = (float)1.4;
#ifdef __WXMOTIF__
ratio = (float)2.1;
#endif
-
+
SetBackgroundColour(_T("wheat"));
pDoc = p_Doc;
wxLayoutConstraints* layout;
SetAutoLayout(true);
-
+
m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:"));
m_Label1->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->height.AsIs();
layout->width.Absolute(75);
m_Label1->SetConstraints(layout);
-
+
int w;
- m_Label1->GetSize(&w, &chSize);
-
- m_UserName = new wxTextCtrl(this, wxID_ANY, _T(""));
+ m_Label1->GetSize(&w, &chSize);
+
+ m_UserName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
m_UserName->SetFont(* pDoc->ft_Doc);
chSize = (int) (m_UserName->GetCharHeight()*ratio);
-
+
layout = new wxLayoutConstraints;
layout->left.SameAs(m_Label1, wxRight, 10);
layout->centreY.SameAs(m_Label1,wxCentreY);
layout->height.Absolute(chSize);
// layout->height.AsIs();
m_UserName->SetConstraints(layout);
-
-
+
+
m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:"));
m_Label2->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->height.AsIs();
layout->width.SameAs(m_Label1, wxWidth);
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);
layout = new wxLayoutConstraints;
layout->left.SameAs(m_UserName, wxLeft);
layout->height.Absolute(chSize);
//layout->height.AsIs();
m_Password->SetConstraints(layout);
-
+
m_OK = new wxButton(this, wxID_OK, _("OK"));
m_OK->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->height.AsIs();
layout->width.Absolute(75);
m_OK->SetConstraints(layout);
-
+
m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
m_Cancel->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->height.AsIs();
layout->width.SameAs(m_OK, wxWidth);
m_Cancel->SetConstraints(layout);
-
+
m_OK->SetDefault();
m_UserName->SetFocus();
-
- s_User = _T("");
- s_Password = _T("");
+
+ s_User = wxEmptyString;
+ s_Password = wxEmptyString;
Layout();
}
// open/close
// 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)
- bool Create(const wxChar *szFileName, bool bOverwrite = FALSE,
+ bool Create(const wxChar *szFileName, bool bOverwrite = false,
int access = wxS_DEFAULT);
bool Open(const wxChar *szFileName, OpenMode mode = read,
int access = wxS_DEFAULT);
// start enumerating font facenames (either all of them or those which
// support the given encoding) - will result in OnFacename() being
// called for each available facename (until they are exhausted or
- // OnFacename returns FALSE)
+ // OnFacename returns false)
virtual bool EnumerateFacenames
(
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
- bool fixedWidthOnly = FALSE
+ bool fixedWidthOnly = false
);
// enumerate the different encodings either for given font facename or for
virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString);
// callbacks which are called after one of EnumerateXXX() functions from
- // above is invoked - all of them may return FALSE to stop enumeration or
- // TRUE to continue with it
+ // above is invoked - all of them may return false to stop enumeration or
+ // true to continue with it
// called by EnumerateFacenames
virtual bool OnFacename(const wxString& facename)
- {
+ {
if (m_Facenames == NULL) m_Facenames = new wxArrayString;
m_Facenames -> Add(facename);
- return TRUE;
+ return true;
}
// called by EnumerateEncodings
virtual bool OnFontEncoding(const wxString& WXUNUSED(facename),
const wxString& encoding)
- {
+ {
if (m_Encodings == NULL) m_Encodings = new wxArrayString;
m_Encodings -> Add(encoding);
- return TRUE;
+ return true;
}
-
+
// convenience function that returns array of facenames. Cannot be called
// before EnumerateFacenames.
- wxArrayString *GetFacenames()
+ wxArrayString *GetFacenames()
{ return m_Facenames; }
// convenience function that returns array of encodings.
// Cannot be called before EnumerateEncodings.
- wxArrayString *GetEncodings()
+ wxArrayString *GetEncodings()
{ return m_Encodings; }
-
+
// virtual dtor for the base class
- virtual ~wxFontEnumerator()
- {
+ virtual ~wxFontEnumerator()
+ {
if (m_Facenames) delete m_Facenames;
if (m_Encodings) delete m_Encodings;
}
-
+
private:
wxArrayString *m_Facenames, *m_Encodings;
public:
wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL)
const wxChar *szTitle, // the title of the frame
- bool bShow = TRUE, // show window immediately?
- bool bPassToOld = TRUE); // pass messages to the old target?
+ bool bShow = true, // show window immediately?
+ bool bPassToOld = true); // pass messages to the old target?
~wxLogWindow();
// window operations
// show/hide the log window
- void Show(bool bShow = TRUE);
+ void Show(bool bShow = true);
// retrieve the pointer to the frame
wxFrame *GetFrame() const;
virtual void OnFrameCreate(wxFrame *frame);
// called if the user closes the window interactively, will not be
// 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
virtual bool OnFrameClose(wxFrame *frame);
// called right before the log frame is going to be deleted: will
@param newmsg if used, new message to display
@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
the program decided to continue the operation (e.g., user didn't
*/
void Resume();
- bool Show( bool show = TRUE );
+ bool Show( bool show = true );
protected:
// callback for optional abort button
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
- virtual void SetNoAntiAliasing( bool no = TRUE );
+ virtual void SetNoAntiAliasing( bool no = true );
virtual bool GetNoAntiAliasing();
// implementation from now on
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
- virtual void SetNoAntiAliasing( bool no = TRUE );
+ virtual void SetNoAntiAliasing( bool no = true );
virtual bool GetNoAntiAliasing();
// implementation from now on
// Displays help window and focuses index.
bool DisplayIndex();
- // Searches for keyword. Returns TRUE and display page if found, return
- // FALSE otherwise
+ // Searches for keyword. Returns true and display page if found, return
+ // false otherwise
// Syntax of keyword is Altavista-like:
// * words are separated by spaces
// (but "\"hello world\"" is only one world "hello world")
// call this to let wxHtmlHelpFrame know page changed
void NotifyPageChanged();
-
+
// Refreshes Contents and Index tabs
void RefreshLists();
-
+
protected:
void Init(wxHtmlHelpData* data = NULL);
virtual ~wxFrame();
- virtual bool Show(bool show = TRUE);
+ virtual bool Show(bool show = true);
// Set menu bar
void SetMenuBar(wxMenuBar *menu_bar);
// Create toolbar
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = -1,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr);
virtual void SetToolBar(wxToolBar *toolbar);
virtual void PositionToolBar();
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnActivate(wxActivateEvent& event);
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
WXWidget GetMenuBarWidget() const;
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
virtual bool IsFree() const;
virtual bool RealizeResource();
virtual WXHANDLE GetResourceHandle() const;
- virtual bool FreeResource(bool force = FALSE);
+ virtual bool FreeResource(bool force = false);
// for consistency with other wxMSW classes
WXHFONT GetHFONT() const;
// --------
wxTreeCtrl() { Init(); }
- wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
+ wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
virtual ~wxTreeCtrl();
- bool Create(wxWindow *parent, wxWindowID id = -1,
+ bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
// allow the user to expand the items which don't have any children now
// - but instead add them only when needed, thus minimizing memory
// 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
- 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
- void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE);
+ void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
// set the items text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
// 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
size_t GetChildrenCount(const wxTreeItemId& item,
- bool recursively = TRUE) const;
+ bool recursively = true) const;
// 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
wxTreeItemId GetRootItem() const;
#if WXWIN_COMPATIBILITY_2_2
// deprecated: Use GetItemParent instead.
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(); }
#endif // WXWIN_COMPATIBILITY_2_2
// edited simultaneously)
wxTextCtrl* GetEditControl() const;
// 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
// this function is called to compare 2 items and should return -1, 0
// get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
- bool textOnly = FALSE) const;
+ bool textOnly = false) const;
// deprecated
// ----------
// get/set the check state for the item (only for wxTR_MULTIPLE)
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)
void SetState(const wxTreeItemId& node, int state);
// the hash storing the items attributes (indexed by item ids)
wxMapTreeAttr m_attrs;
- // TRUE if the hash above is not empty
+ // true if the hash above is not empty
bool m_hasAnyAttr;
// used for dragging
,int nFamily
,int nStyle
,int nWeight
- ,bool bUnderlined = FALSE
+ ,bool bUnderlined = false
,const wxString& rsFace = wxEmptyString
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
)
,int nFamily
,int nStyle
,int nWeight
- ,bool bUnderlined = FALSE
+ ,bool bUnderlined = false
,const wxString& rsFace = wxEmptyString
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
);
virtual bool IsFree(void) const;
virtual bool RealizeResource(void);
virtual WXHANDLE GetResourceHandle(void);
- virtual bool FreeResource(bool bForce = FALSE);
+ virtual bool FreeResource(bool bForce = false);
WXHFONT GetHFONT(void) const;
END_EVENT_TABLE()
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, _T("Art resources browser"),
- wxDefaultPosition, wxDefaultSize,
+ : wxDialog(parent, wxID_ANY, _T("Art resources browser"),
+ wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxSizer *subsizer;
-
+
wxChoice *choice = new wxChoice(this, wxID_ANY);
FillClients(choice);
-
+
subsizer = new wxBoxSizer(wxHORIZONTAL);
subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
subsizer->Add(choice, 1, wxLEFT, 5);
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
subsizer = new wxBoxSizer(wxHORIZONTAL);
-
+
m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
wxLC_REPORT | wxSUNKEN_BORDER);
m_list->InsertColumn(0, _T("wxArtID"));
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
-
+
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm));
subsub->Add(m_canvas);
subsizer->Add(subsub);
sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10);
-
+
wxButton *ok = new wxButton(this, wxID_OK, _T("Close"));
ok->SetDefault();
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
-
+
SetSizer(sizer);
- SetAutoLayout(true);
sizer->Fit(this);
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
void wxArtBrowserDialog::SetArtClient(const wxArtClient& client)
{
wxBusyCursor bcur;
-
+
wxImageList *img = new wxImageList(16, 16);
img->Add(wxIcon(null_xpm));
int index = 0;
// Make a menubar
wxMenu *file_menu = new wxMenu;
-
+
file_menu->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M"));
#if wxUSE_FINDREPLDLG
wxMenu *find_menu = new wxMenu;
- find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), _T(""), true);
- find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-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"), wxEmptyString, true);
file_menu->Append(wxID_ANY,_T("Searching"),find_menu);
#endif // wxUSE_FINDREPLDLG
#if USE_MODAL_PRESENTATION
wxMenu *modal_menu = new wxMenu;
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);
#endif // USE_MODAL_PRESENTATION
m_dlgFind =
m_dlgReplace = NULL;
#endif
-
-#if wxUSE_COLOURDLG
+
+#if wxUSE_COLOURDLG
m_clrData.SetChooseFull(true);
for (int i = 0; i < 16; i++)
{
m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16));
}
#endif // wxUSE_COLOURDLG
-
+
CreateStatusBar();
}
{
wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
_T("Password entry dialog"),
- _T(""),
+ wxEmptyString,
this);
if ( !!pwd )
{
(
this,
_T("Testing open file dialog"),
- _T(""),
- _T(""),
+ wxEmptyString,
+ wxEmptyString,
#ifdef __WXMOTIF__
_T("C++ files (*.cpp)|*.cpp")
#else
static wxString s_extDef;
wxString path = wxFileSelector(
_T("Select the file to load"),
- _T(""), _T(""),
+ wxEmptyString, wxEmptyString,
s_extDef,
_T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"),
wxCHANGE_DIR,
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
{
- wxString wildcards =
+ wxString wildcards =
#ifdef __WXMOTIF__
_T("C++ files (*.cpp)|*.cpp");
#else
_T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
#endif
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
- _T(""), _T(""), wildcards,
+ wxEmptyString, wxEmptyString, wildcards,
wxMULTIPLE);
if (dialog.ShowModal() == wxID_OK)
{
wxFileDialog dialog(this,
_T("Testing save file dialog"),
- _T(""),
+ wxEmptyString,
_T("myletter.doc"),
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
wxSAVE|wxOVERWRITE_PROMPT);
sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5);
sizerTop->Add(check, 1, wxEXPAND | wxALL, 5);
- SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5);
- SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
#if wxUSE_TEXTDLG
wxGetTextFromUser(_T("Dummy prompt"),
_T("Modal dialog called from dialog"),
- _T(""), this);
+ wxEmptyString, this);
#else
wxMessageBox(_T("Modal dialog called from dialog"));
#endif // wxUSE_TEXTDLG
fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") );
wxMenu *viewMenu = new wxMenu;
- viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width..."), _T("") );
- viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width..."), _T("") );
+ viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") );
+ viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") );
viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") );
- viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), _T(""), wxITEM_CHECK );
- viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), _T(""), wxITEM_CHECK );
+ viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK );
wxMenu *rowLabelMenu = new wxMenu;
0,
wxEXPAND );
- SetAutoLayout(true);
SetSizer( topSizer );
topSizer->Fit( this );
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
if ( ev.GetRow() != -1 )
{
logBuf << _T("Left click on row label ") << ev.GetRow();
void GridFrame::OnCellLeftClick( wxGridEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
logBuf << _T("Left click at row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
void GridFrame::OnRowSize( wxGridSizeEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
logBuf << _T("Resized row ") << ev.GetRowOrCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
void GridFrame::OnColSize( wxGridSizeEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
logBuf << _T("Resized col ") << ev.GetRowOrCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
void GridFrame::OnSelectCell( wxGridEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
if ( ev.Selecting() )
logBuf << _T("Selected ");
else
void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
if ( ev.Selecting() )
logBuf << _T("Selected ");
else
void GridFrame::OnCellValueChanged( wxGridEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
logBuf << _T("Value changed for cell at")
<< _T(" row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();
{
wxString key = wxGetTextFromUser(_T("Search for?"),
_T("Search help for keyword"),
- _T(""),
+ wxEmptyString,
this);
if(! key.IsEmpty())
helpController.KeywordSearch(key);
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
- SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
html -> SetBorders(0);
html -> LoadPage(wxT("data/about.htm"));
- html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
+ html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
html -> GetInternalRepresentation() -> GetHeight());
topsizer -> Add(html, 1, wxALL, 10);
topsizer -> Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
-
+
wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK"));
bu1 -> SetDefault();
topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
- dlg.SetAutoLayout(true);
dlg.SetSizer(topsizer);
topsizer -> Fit(&dlg);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
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(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
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(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
Reset();
m_dirty = false;
- panel->SetAutoLayout(true);
panel->SetSizer(sizerTop);
sizerTop->Fit(this);
m_panel->SetSizer(m_sizerFrame);
- m_panel->SetAutoLayout(true);
-
m_sizerFrame->Fit(this);
m_sizerFrame->SetSizeHints(this);
sizerTop->Add(-1, 10, 1, wxGROW);
sizerTop->Add(statbarBottom, 0, wxGROW);
- SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->Fit(this);
m_statbmp->Refresh();
#endif
- SetStatusText(_T(""), Field_Clock);
+ SetStatusText(wxEmptyString, Field_Clock);
}
}
class WXDLLEXPORT wxFontPreviewer : public wxWindow
{
public:
- wxFontPreviewer(wxWindow *parent) : wxWindow(parent, -1) {}
+ wxFontPreviewer(wxWindow *parent) : wxWindow(parent, wxID_ANY) {}
private:
void OnPaint(wxPaintEvent& event);
dc.GetTextExtent( wxT("X"), &w, &h);
dc.SetTextForeground(GetForegroundColour());
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
- dc.DrawText(_("ABCDEFGabcdefg12345"),
+ dc.DrawText(_("ABCDEFGabcdefg12345"),
10, size.y/2 - h/2);
dc.DestroyClippingRegion();
}
void wxGenericFontDialog::Init()
{
- m_useEvents = FALSE;
+ m_useEvents = false;
m_previewer = NULL;
Create( m_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") ) )
{
wxFAIL_MSG( wxT("wxFontDialog creation failed") );
- return FALSE;
+ return false;
}
InitializeFont();
CreateWidgets();
-
+
// sets initial font in preview area
wxCommandEvent dummy;
OnChangeFont(dummy);
-
- return TRUE;
+
+ return true;
}
int wxGenericFontDialog::ShowModal()
sizer->Add(weightChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
sizer->Add(colourChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
-
+
sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(pointSizeChoice, 0, wxALIGN_CENTER | wxLEFT, 10);
sizer->Add(underLineCheckBox, 0, wxALIGN_CENTER | wxLEFT, 10);
topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10);
}
-
+
topsizer->Add(m_previewer, 1, wxALL | wxEXPAND, 10);
topsizer->SetItemMinSize(m_previewer, 430, 100);
sizer->Add(cancelButton, 0, wxRIGHT, 10);
topsizer->Add(sizer, 0, wxALIGN_RIGHT | wxBOTTOM, 10);
- SetAutoLayout(TRUE);
SetSizer(topsizer);
topsizer->SetSizeHints(this);
topsizer->Fit(this);
delete[] styles;
delete[] weights;
delete[] pointSizes;
-
+
// Don't block events any more
- m_useEvents = TRUE;
+ m_useEvents = true;
}
void wxGenericFontDialog::InitializeFont()
int fontWeight = wxNORMAL;
int fontStyle = wxNORMAL;
int fontSize = 12;
- int fontUnderline = FALSE;
+ bool fontUnderline = false;
if (m_fontData.m_initialFont.Ok())
{
fontUnderline = m_fontData.m_initialFont.GetUnderlined();
}
- dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
+ dialogFont = wxFont(fontSize, fontFamily, fontStyle,
+ fontWeight, fontUnderline);
if (m_previewer)
m_previewer->SetFont(dialogFont);
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
m_previewer->SetFont(dialogFont);
- if (colourChoice->GetStringSelection() != wxT(""))
+ if ( !colourChoice->GetStringSelection().empty() )
{
wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection());
if (col.Ok())
#if wxUSE_FILE
EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave)
#endif // wxUSE_FILE
- EVT_LIST_ITEM_SELECTED(-1, wxLogDialog::OnListSelect)
+ EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect)
END_EVENT_TABLE()
#endif // wxUSE_LOG_DIALOG
#if wxUSE_FILE && wxUSE_FILEDLG
// 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),
-// FALSE if file couldn't be opened/created and -1 if the file selection
+// 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
// dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL);
{
m_bErrors =
m_bWarnings =
- m_bHasMessages = FALSE;
+ m_bHasMessages = false;
m_aMessages.Empty();
m_aSeverity.Empty();
return;
// 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();
if ( !!appName )
m_aMessages.Add(szString);
m_aSeverity.Add(wxLOG_Message);
m_aTimes.Add((long)t);
- m_bHasMessages = TRUE;
+ m_bHasMessages = true;
}
break;
m_aSeverity.Empty();
m_aTimes.Empty();
#endif // wxUSE_LOG_DIALOG
- m_bErrors = TRUE;
+ m_bErrors = true;
}
// fall through
case wxLOG_Warning:
if ( !m_bErrors ) {
// for the warning we don't discard the info messages
- m_bWarnings = TRUE;
+ m_bWarnings = true;
}
m_aMessages.Add(szString);
m_aSeverity.Add((int)level);
m_aTimes.Add((long)t);
- m_bHasMessages = TRUE;
+ m_bHasMessages = true;
break;
}
}
END_EVENT_TABLE()
wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle)
- : wxFrame(pParent, -1, szTitle)
+ : wxFrame(pParent, wxID_ANY, szTitle)
{
m_log = log;
- m_pTextCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition,
+ m_pTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize,
wxTE_MULTILINE |
wxHSCROLL |
{
// instead of closing just hide the window to be able to Show() it
// later
- Show(FALSE);
+ Show(false);
}
}
m_pLogFrame = new wxLogFrame(pParent, this, szTitle);
if ( bShow )
- m_pLogFrame->Show(TRUE);
+ m_pLogFrame->Show();
}
void wxLogWindow::Show(bool bShow)
bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame))
{
// allow to close
- return TRUE;
+ return true;
}
void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame))
const wxArrayLong& times,
const wxString& caption,
long style)
- : wxDialog(parent, -1, caption,
+ : wxDialog(parent, wxID_ANY, caption,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
while ( !!msg );
}
- m_showingDetails = FALSE; // not initially
+ m_showingDetails = false; // not initially
m_listctrl = (wxListCtrl *)NULL;
#if wxUSE_STATLINE
default:
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();
sizerAll->Add(CreateTextSizer(message), 1,
sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN);
- SetAutoLayout(TRUE);
SetSizer(sizerTop);
// see comments in OnDetails()
#endif // wxUSE_FILE
#if wxUSE_STATLINE
- m_statline = new wxStaticLine(this, -1);
+ m_statline = new wxStaticLine(this, wxID_ANY);
#endif // wxUSE_STATLINE
// create the list ctrl now
- m_listctrl = new wxListCtrl(this, -1,
+ m_listctrl = new wxListCtrl(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER |
wxLC_REPORT |
wxART_INFORMATION
};
- bool loadedIcons = TRUE;
+ bool loadedIcons = true;
for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ )
{
// Degrade gracefully.
if ( !bmp.Ok() )
{
- loadedIcons = FALSE;
+ loadedIcons = false;
break;
}
// VS: this is neccessary in order to force frame redraw under
// WindowMaker or fvwm2 (and probably other broken WMs).
// Otherwise, detailed list wouldn't be displayed.
- Show(TRUE);
+ Show();
#endif // wxGTK
}
#if wxUSE_FILE && wxUSE_FILEDLG
// 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),
-// FALSE if file couldn't be opened/created and -1 if the file selection
+// 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
// dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
{
// ---------
bool bOk;
if ( wxFile::Exists(filename) ) {
- bool bAppend = FALSE;
+ bool bAppend = false;
wxString strMsg;
strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"),
filename.c_str());
switch ( wxMessageBox(strMsg, _("Question"),
wxICON_QUESTION | wxYES_NO | wxCANCEL) ) {
case wxYES:
- bAppend = TRUE;
+ bAppend = true;
break;
case wxNO:
- bAppend = FALSE;
+ bAppend = false;
break;
case wxCANCEL:
bOk = file.Open(filename, wxFile::write_append);
}
else {
- bOk = file.Create(filename, TRUE /* overwrite */);
+ bOk = file.Create(filename, true /* overwrite */);
}
}
else {
int maximum,
wxWindow *parent,
int style)
- : wxDialog(parent, -1, title)
+ : wxDialog(parent, wxID_ANY, title)
{
// we may disappear at any moment, let the others know about it
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
// FIXME: should probably have a (extended?) window style for this
if ( !hasAbortButton )
{
- EnableCloseButton(FALSE);
+ EnableCloseButton(false);
}
#endif // wxMSW
long widthText;
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->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
// note that we can't use wxGA_SMOOTH because it happens to
// cause the dialog to be modal. Have an extra
// style argument to wxProgressDialog, perhaps.
- m_gauge = new wxGauge(this, -1, m_maximum,
+ m_gauge = new wxGauge(this, wxID_ANY, m_maximum,
wxDefaultPosition, wxDefaultSize,
wxGA_HORIZONTAL);
m_btnAbort = (wxButton *)NULL;
}
- SetAutoLayout(TRUE);
+ SetAutoLayout(true);
Layout();
sizeDlg.y += 2*LAYOUT_Y_MARGIN;
else
{
if ( m_parentTop )
- m_parentTop->Enable(FALSE);
+ m_parentTop->Disable();
m_winDisabler = NULL;
}
- Show(TRUE);
- Enable(TRUE); // enable this window
+ Show();
+ Enable();
// this one can be initialized even if the others are unknown for now
//
{
wxLayoutConstraints *c;
- wxStaticText *label = new wxStaticText(this, -1, _("unknown"));
+ wxStaticText *label = new wxStaticText(this, wxID_ANY, _("unknown"));
c = new wxLayoutConstraints;
// VZ: I like the labels be centered - if the others don't mind, you may
c->height.AsIs();
label->SetConstraints(c);
- wxStaticText *dummy = new wxStaticText(this, -1, text);
+ wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text);
c = new wxLayoutConstraints;
c->right.LeftOf(label);
c->top.SameAs(label, wxTop, 0);
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
m_state = Finished;
if( !(GetWindowStyle() & wxPD_AUTO_HIDE) )
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
else // enable the button to give the user a way to close the dlg
{
- EnableCloseButton(TRUE);
+ EnableCloseButton();
}
#endif // __WXMSW__
if ( m_state == Uncancelable )
{
// can't close this dialog
- event.Veto(TRUE);
+ event.Veto();
}
else if ( m_state == Finished )
{
else
{
if ( m_parentTop )
- m_parentTop->Enable(TRUE);
+ m_parentTop->Enable();
}
}
wxTipProvider *tipProvider,
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)
bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); }
{
return _("Tips not available, sorry!");
}
-
+
wxString tip;
// Comments start with a # symbol.
// 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
- // 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
+ // 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]
+ // case of a comment-only tips file, or the developer has vetoed
// them all via PreprecessTip().
for ( size_t i=0; i < count; i++ )
- {
- // 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
+ {
+ // 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
// as changing to a different textfile, with less tips). So check
// to see at last line of text file, (or past it)...
if ( m_currentTip >= count )
{
// .. and if so, wrap back to line 0.
m_currentTip = 0;
- }
-
+ }
+
// Read the tip, and increment the current tip counter.
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.
- tip = PreprocessTip(tip);
-
+ tip = PreprocessTip(tip);
+
// Break if tip isn't a comment, and isn't an empty string
// (or only stray space characters).
if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) )
break;
}
}
-
+
// If tip starts with '_(', then it is a gettext string of format
// _("My \"global\" tip text") so first strip off the leading '_("'...
if ( tip.StartsWith(wxT("_(\"" ), &tip))
{
//...and strip off the trailing '")'...
tip = tip.BeforeLast(wxT('\"'));
- // ...and replace escaped quotes
- tip.Replace(wxT("\\\""), wxT("\""));
- }
-
- return tip;
+ // ...and replace escaped quotes
+ tip.Replace(wxT("\\\""), wxT("\""));
+ }
+
+ return tip;
}
// ----------------------------------------------------------------------------
wxTipDialog::wxTipDialog(wxWindow *parent,
wxTipProvider *tipProvider,
bool showAtStartup)
- : wxDialog(parent, -1, _("Tip of the Day"),
+ : wxDialog(parent, wxID_ANY, _("Tip of the Day"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
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);
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__)
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
#else
//
// 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),
wxTE_MULTILINE |
wxTE_READONLY |
// 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.
//
-// wxStaticBitmap* bmp = new wxStaticBitmap(this, -1, vBitmap);
+// wxStaticBitmap* bmp = new wxStaticBitmap(this, wxID_ANY, vBitmap);
//
//#else
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
SetTipText();
- SetAutoLayout(TRUE);
SetSizer( topsizer );
topsizer->SetSizeHints( this );
if (data)
{
m_Data = data;
- m_DataCreated = FALSE;
+ m_DataCreated = false;
} else
{
m_Data = new wxHtmlHelpData();
- m_DataCreated = TRUE;
+ m_DataCreated = true;
}
m_ContentsBox = NULL;
m_Cfg.w = 700;
m_Cfg.h = 480;
m_Cfg.sashpos = 240;
- m_Cfg.navig_on = TRUE;
+ m_Cfg.navig_on = true;
m_NormalFonts = m_FixedFonts = NULL;
m_NormalFace = m_FixedFace = wxEmptyString;
#endif
m_PagesHash = NULL;
- m_UpdateContents = TRUE;
+ m_UpdateContents = true;
m_helpController = (wxHelpControllerBase*) NULL;
}
if (m_Config)
ReadCustomization(m_Config, m_ConfigRoot);
- wxFrame::Create(parent, id, _("Help"),
- wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h),
+ wxFrame::Create(parent, id, _("Help"),
+ wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h),
wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp"));
GetPosition(&m_Cfg.x, &m_Cfg.y);
m_Splitter = new wxSplitterWindow(this);
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,
wxDefaultPosition, wxDefaultSize);
wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook);
-
+
navigSizer = new wxBoxSizer(wxVERTICAL);
navigSizer->Add(nbs, 1, wxEXPAND);
- m_NavigPan->SetAutoLayout(TRUE);
m_NavigPan->SetSizer(navigSizer);
}
else
{
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
-
+
topsizer->Add(0, 10);
-
- dummy->SetAutoLayout(TRUE);
+
dummy->SetSizer(topsizer);
if ( style & wxHF_BOOKMARKS )
{
- m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST,
+ m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST,
wxEmptyString,
- wxDefaultPosition, wxDefaultSize,
+ wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY | wxCB_SORT);
m_Bookmarks->Append(_("(bookmarks)"));
for (unsigned i = 0; i < m_BookmarksNames.GetCount(); i++)
m_Bookmarks->SetSelection(0);
wxBitmapButton *bmpbt1, *bmpbt2;
- bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD,
- wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK,
+ bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD,
+ wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK,
wxART_HELP_BROWSER));
- bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE,
- wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK,
+ bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE,
+ wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK,
wxART_HELP_BROWSER));
#if wxUSE_TOOLTIPS
bmpbt1->SetToolTip(_("Add current page to bookmarks"));
#endif // wxUSE_TOOLTIPS
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
-
+
sizer->Add(m_Bookmarks, 1, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5);
sizer->Add(bmpbt1, 0, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 2);
sizer->Add(bmpbt2, 0, wxALIGN_CENTRE_VERTICAL, 0);
-
+
topsizer->Add(sizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 10);
}
m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL,
wxDefaultPosition, wxDefaultSize,
- wxSUNKEN_BORDER |
+ wxSUNKEN_BORDER |
wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT |
wxTR_LINES_AT_ROOT);
m_ContentsBox->AssignImageList(ContentsImageList);
-
+
topsizer->Add(m_ContentsBox, 1,
wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,
2);
// index listbox panel?
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);
- dummy->SetAutoLayout(TRUE);
dummy->SetSizer(topsizer);
- m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString,
- wxDefaultPosition, wxDefaultSize,
+ m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
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"));
- m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO,
+ m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO,
wxEmptyString, wxDefaultPosition,
- wxDefaultSize,
+ wxDefaultSize,
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
- m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST,
- wxDefaultPosition, wxDefaultSize,
+ m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST,
+ wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_SINGLE);
#if wxUSE_TOOLTIPS
wxSizer *btsizer = new wxBoxSizer(wxHORIZONTAL);
btsizer->Add(m_IndexButton, 0, wxRIGHT, 2);
btsizer->Add(m_IndexButtonAll);
- topsizer->Add(btsizer, 0,
+ topsizer->Add(btsizer, 0,
wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10);
topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2);
topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2);
// search list panel?
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);
- dummy->SetAutoLayout(TRUE);
dummy->SetSizer(sizer);
- m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT,
- wxEmptyString,
- wxDefaultPosition, wxDefaultSize,
+ m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT,
+ wxEmptyString,
+ wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
- m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
+ m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
wxDefaultPosition, wxDefaultSize);
- m_SearchCaseSensitive = new wxCheckBox(dummy, -1, _("Case sensitive"));
- m_SearchWholeWords = new wxCheckBox(dummy, -1, _("Whole words only"));
+ m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive"));
+ m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only"));
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
#if wxUSE_TOOLTIPS
m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above"));
#endif //wxUSE_TOOLTIPS
- m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST,
- wxDefaultPosition, wxDefaultSize,
+ m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST,
+ wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_SINGLE);
-
+
sizer->Add(m_SearchText, 0, wxEXPAND | wxALL, 10);
sizer->Add(m_SearchChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10);
m_SearchPage = notebook_page;
}
- m_HtmlWin->Show(TRUE);
+ m_HtmlWin->Show();
RefreshLists();
if ( m_Cfg.navig_on )
{
- m_NavigPan->Show(TRUE);
+ m_NavigPan->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
else
{
- m_NavigPan->Show(FALSE);
+ m_NavigPan->Show(false);
m_Splitter->Initialize(m_HtmlWin);
}
}
-
+
// Reduce flicker by updating the splitter pane sizes before the
// frame is shown
wxSizeEvent sizeEvent(GetSize(), GetId());
ProcessEvent(sizeEvent);
-
+
m_Splitter->UpdateSize();
-
- return TRUE;
+
+ return true;
}
wxHtmlHelpFrame::~wxHtmlHelpFrame()
delete m_Data;
if (m_NormalFonts) delete m_NormalFonts;
if (m_FixedFonts) delete m_FixedFonts;
- if (m_PagesHash)
+ if (m_PagesHash)
{
WX_CLEAR_HASH_TABLE(*m_PagesHash);
delete m_PagesHash;
#if wxUSE_TOOLBAR
void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
{
- wxBitmap wpanelBitmap =
+ wxBitmap wpanelBitmap =
wxArtProvider::GetBitmap(wxART_HELP_SIDE_PANEL, wxART_HELP_BROWSER);
- wxBitmap wbackBitmap =
+ wxBitmap wbackBitmap =
wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_HELP_BROWSER);
- wxBitmap wforwardBitmap =
+ wxBitmap wforwardBitmap =
wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_HELP_BROWSER);
- wxBitmap wupnodeBitmap =
+ wxBitmap wupnodeBitmap =
wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_HELP_BROWSER);
- wxBitmap wupBitmap =
+ wxBitmap wupBitmap =
wxArtProvider::GetBitmap(wxART_GO_UP, wxART_HELP_BROWSER);
- wxBitmap wdownBitmap =
+ wxBitmap wdownBitmap =
wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_HELP_BROWSER);
- wxBitmap wopenBitmap =
+ wxBitmap wopenBitmap =
wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_HELP_BROWSER);
- wxBitmap wprintBitmap =
+ wxBitmap wprintBitmap =
wxArtProvider::GetBitmap(wxART_PRINT, wxART_HELP_BROWSER);
- wxBitmap woptionsBitmap =
+ wxBitmap woptionsBitmap =
wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_HELP_BROWSER);
wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() &&
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Show/hide navigation panel"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Go back"));
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Go forward"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Go one level up in document hierarchy"));
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Previous page"));
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Next page"));
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
if (style & wxHF_OPEN_FILES)
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Open HTML document"));
#if wxUSE_PRINTING_ARCHITECTURE
if (style & wxHF_PRINT)
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Print this page"));
#endif
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
- FALSE, -1, -1, (wxObject *) NULL,
+ false, -1, -1, (wxObject *) NULL,
_("Display options dialog"));
}
#endif //wxUSE_TOOLBAR
{
m_HtmlWin->LoadPage(url);
NotifyPageChanged();
- return TRUE;
+ return true;
}
- return FALSE;
+
+ return false;
}
bool wxHtmlHelpFrame::Display(const int id)
{
m_HtmlWin->LoadPage(url);
NotifyPageChanged();
- return TRUE;
+ return true;
}
- return FALSE;
+
+ return false;
}
bool wxHtmlHelpFrame::DisplayContents()
{
if (! m_ContentsBox)
- return FALSE;
+ return false;
+
if (!m_Splitter->IsSplit())
{
- m_NavigPan->Show(TRUE);
- m_HtmlWin->Show(TRUE);
+ m_NavigPan->Show();
+ m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
- m_Cfg.navig_on = TRUE;
+ m_Cfg.navig_on = true;
}
+
m_NavigNotebook->SetSelection(0);
+
if (m_Data->GetBookRecArray().GetCount() > 0)
{
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
if (!book.GetStart().IsEmpty())
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
}
- return TRUE;
+
+ return true;
}
bool wxHtmlHelpFrame::DisplayIndex()
{
if (! m_IndexList)
- return FALSE;
+ return false;
+
if (!m_Splitter->IsSplit())
{
- m_NavigPan->Show(TRUE);
- m_HtmlWin->Show(TRUE);
+ m_NavigPan->Show();
+ m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
+
m_NavigNotebook->SetSelection(1);
+
if (m_Data->GetBookRecArray().GetCount() > 0)
{
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
if (!book.GetStart().IsEmpty())
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
}
- return TRUE;
+
+ return true;
}
if (!m_Splitter->IsSplit())
{
- m_NavigPan->Show(TRUE);
- m_HtmlWin->Show(TRUE);
+ m_NavigPan->Show();
+ m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
m_NavigNotebook->SetSelection(m_SearchPage);
m_SearchList->Clear();
m_SearchText->SetValue(keyword);
- m_SearchButton->Enable(false);
+ m_SearchButton->Disable();
if (m_SearchChoice->GetSelection() != 0)
book = m_SearchChoice->GetStringSelection();
while (status.IsActive())
{
curi = status.GetCurIndex();
- if (curi % 32 == 0
+ if (curi % 32 == 0
#if wxUSE_PROGRESSDLG
- && progress.Update(curi) == FALSE
+ && !progress.Update(curi)
#endif
)
break;
}
}
- m_SearchButton->Enable(TRUE);
+ m_SearchButton->Enable();
m_SearchText->SetSelection(0, keyword.Length());
m_SearchText->SetFocus();
}
{
m_NavigNotebook->SetSelection(m_IndexPage);
m_IndexList->Clear();
- m_IndexButton->Enable(false);
- m_IndexButtonAll->Enable(false);
+ m_IndexButton->Disable();
+ m_IndexButtonAll->Disable();
m_IndexText->SetValue(keyword);
wxCommandEvent dummy;
OnIndexFind(dummy); // what a hack...
- m_IndexButton->Enable(true);
- m_IndexButtonAll->Enable(true);
+ m_IndexButton->Enable();
+ m_IndexButtonAll->Enable();
foundcnt = m_IndexList->GetCount();
}
// set its icon accordingly
bool imaged[MAX_ROOTS];
m_ContentsBox->DeleteAllItems();
-
+
roots[0] = m_ContentsBox->AddRoot(_("(Help)"));
- imaged[0] = TRUE;
+ imaged[0] = true;
for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++)
{
roots[1] = m_ContentsBox->AppendItem(roots[0],
it->m_Name, IMG_Book, -1,
new wxHtmlHelpTreeItemData(i));
- m_ContentsBox->SetItemBold(roots[1], TRUE);
+ m_ContentsBox->SetItemBold(roots[1], true);
}
- imaged[1] = TRUE;
+ imaged[1] = true;
}
// ...and their contents:
else
roots[it->m_Level + 1] = m_ContentsBox->AppendItem(
roots[it->m_Level], it->m_Name, IMG_Page,
-1, new wxHtmlHelpTreeItemData(i));
- imaged[it->m_Level + 1] = FALSE;
+ imaged[it->m_Level + 1] = false;
}
m_PagesHash->Put(it->GetFullPath(),
m_ContentsBox->SetItemImage(roots[it->m_Level], image);
m_ContentsBox->SetItemImage(roots[it->m_Level], image,
wxTreeItemIcon_Selected);
- imaged[it->m_Level] = TRUE;
+ imaged[it->m_Level] = true;
}
}
}
wxSpinCtrl *FontSize;
wxHtmlWindow *TestWin;
- wxHtmlHelpFrameOptionsDialog(wxWindow *parent)
- : wxDialog(parent, -1, wxString(_("Help Browser Options")))
+ wxHtmlHelpFrameOptionsDialog(wxWindow *parent)
+ : wxDialog(parent, wxID_ANY, wxString(_("Help Browser Options")))
{
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5);
- sizer->Add(new wxStaticText(this, -1, _("Normal font:")));
- sizer->Add(new wxStaticText(this, -1, _("Fixed font:")));
- sizer->Add(new wxStaticText(this, -1, _("Font size:")));
+ sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:")));
+ sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:")));
+ 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),
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),
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);
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);
- 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),
1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10);
sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10);
topsizer->Add(sizer2, 0, wxALIGN_RIGHT);
- SetAutoLayout(TRUE);
SetSizer(topsizer);
topsizer->Fit(this);
Centre(wxBOTH);
};
BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog)
- EVT_COMBOBOX(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate)
- EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
+ EVT_COMBOBOX(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdate)
+ EVT_SPINCTRL(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
END_EVENT_TABLE()
void wxHtmlHelpFrame::OptionsDialog()
if (m_FixedFonts == NULL)
{
wxFontEnumerator enu;
- enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE);
+ enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, true /*enum fixed width only*/);
m_FixedFonts = new wxArrayString;
*m_FixedFonts = *enu.GetFacenames();
m_FixedFonts->Sort(wxStringSortAscending);
}
-
+
// VS: We want to show the font that is actually used by wxHtmlWindow.
// If customization dialog wasn't used yet, facenames are empty and
// wxHtmlWindow uses default fonts -- let's find out what they
// are so that we can pass them to the dialog:
if (m_NormalFace.empty())
{
- wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
+ wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false);
m_NormalFace = fnt.GetFaceName();
}
if (m_FixedFace.empty())
{
- wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
+ wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false);
m_FixedFace = fnt.GetFaceName();
}
if (ha)
{
bool olduc = m_UpdateContents;
- m_UpdateContents = FALSE;
+ m_UpdateContents = false;
m_ContentsBox->SelectItem(ha->m_Id);
m_ContentsBox->EnsureVisible(ha->m_Id);
m_UpdateContents = olduc;
{
m_Cfg.sashpos = m_Splitter->GetSashPosition();
m_Splitter->Unsplit(m_NavigPan);
- m_Cfg.navig_on = FALSE;
+ m_Cfg.navig_on = false;
}
else
{
- m_NavigPan->Show(TRUE);
- m_HtmlWin->Show(TRUE);
+ m_NavigPan->Show();
+ m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
- m_Cfg.navig_on = TRUE;
+ m_Cfg.navig_on = true;
}
}
break;
if (pg && m_UpdateContents)
{
it = m_Data->GetContents() + (pg->m_Id);
- m_UpdateContents = FALSE;
+ m_UpdateContents = false;
if (it->m_Page[0] != 0)
m_HtmlWin->LoadPage(it->GetFullPath());
- m_UpdateContents = TRUE;
+ m_UpdateContents = true;
}
}
const wxChar *cstr = sr.c_str();
wxChar mybuff[512];
wxChar *ptr;
- bool first = TRUE;
+ bool first = true;
m_IndexList->Clear();
int cnt = m_Data->GetIndexCnt();
if (index[i].m_Page[0] != 0)
m_HtmlWin->LoadPage(index[i].GetFullPath());
NotifyPageChanged();
- first = FALSE;
+ first = false;
}
}
}
m_IndexList->Clear();
int cnt = m_Data->GetIndexCnt();
- bool first = TRUE;
+ bool first = true;
wxHtmlContentsItem* index = m_Data->GetIndex();
for (int i = 0; i < cnt; i++)
if (index[i].m_Page[0] != 0)
m_HtmlWin->LoadPage(index[i].GetFullPath());
NotifyPageChanged();
- first = FALSE;
+ first = false;
}
}
RemoveGrab();
}
#endif
-
+
if (m_Splitter && m_Cfg.navig_on) m_Cfg.sashpos = m_Splitter->GetSashPosition();
if (m_Config)
#ifdef __WXMAC__
void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
{
- Close(TRUE);
+ Close(true);
}
void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)
if (m_parentSizer == NULL) // setup window:
{
- m_parentAsWindow->SetAutoLayout(true);
m_parentAsWindow->SetSizer(sizer);
wxXmlNode *nd = m_node;
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
- SetAutoLayout(true);
Layout();
}
*/
void ctConfigurationBrowserWindow::CreateControls()
-{
+{
////@begin ctConfigurationBrowserWindow content construction
ctConfigurationBrowserWindow* item1 = this;
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
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);
wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
*/
void ctConfigurationBrowserControlPanel::CreateControls()
-{
+{
////@begin ctConfigurationBrowserControlPanel content construction
ctConfigurationBrowserControlPanel* item5 = this;
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
item5->SetSizer(item6);
- item5->SetAutoLayout(true);
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);
wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0);
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);
////@end ctConfigurationBrowserControlPanel content construction
*/
void ctConfigItemsSelector::CreateControls()
-{
+{
////@begin ctConfigItemsSelector content construction
ctConfigItemsSelector* item1 = this;
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
- item1->SetAutoLayout(true);
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
item2->Add(item3, 1, wxGROW|wxALL, 5);
*/
void ctCustomPropertyDialog::CreateControls()
-{
+{
////@begin ctCustomPropertyDialog content construction
ctCustomPropertyDialog* item1 = this;
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
- item1->SetAutoLayout(true);
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
item2->Add(item3, 1, wxGROW|wxALL, 5);
wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0);
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);
wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0);
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);
wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
- this->SetAutoLayout(true);
this->SetSizer( item0 );
/// Add help text
{
m_attributeEditorGrid->ClearAttributes();
m_propertyDescriptionWindow->SetPage(WrapDescription(wxEmptyString));
- m_elementTitleTextCtrl->SetValue(_T(""));
+ m_elementTitleTextCtrl->SetValue(wxEmptyString);
}
/// Handles detailed editing event.
if (!m_item->CanEditProperty(prop->GetName()))
{
m_attributeEditorGrid->SetReadOnly(row, 1);
-
+
wxColour col(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
m_attributeEditorGrid->SetCellTextColour(row, 1, col);
}
else
{
- m_attributeEditorGrid->SetReadOnly(row, 1, false);
+ m_attributeEditorGrid->SetReadOnly(row, 1, false);
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
}
m_attributeEditorGrid->SetCellEditor(row, 1,
new ctGridCellTextEditor);
}
-
+
return true;
}
if (selRow > -1)
{
row = selRow;
-
+
if (selRow < (int) m_item->GetProperties().GetCount())
{
ctProperty* prop = m_item->GetProperties().GetNth(selRow);
}
if (row == -1)
{
- wxString str = WrapDescription(wxEmptyString);
+ wxString str = WrapDescription(wxEmptyString);
m_propertyDescriptionWindow->SetPage(str);
}
else
ctProperty* prop = FindProperty(row);
if (prop)
{
- wxString str = WrapDescription(m_item->GetDescription(prop));
+ wxString str = WrapDescription(m_item->GetDescription(prop));
m_propertyDescriptionWindow->SetPage(str);
}
}
wxColour col = ctDESCRIPTION_BACKGROUND_COLOUR;
wxString colStr = apColourToHexString(col);
colStr = wxT("#") + colStr;
-
+
wxString str;
str << _T("<HTML><BODY BGCOLOR=\"") << colStr << wxT("\"><FONT SIZE=-1>") ;
str << s;
str << _T("</FONT></BODY></HTML>");
-
- return str;
+
+ return str;
}
/// Intercept cell data change event.
// Apply the new value
property->GetVariant() = variant;
- item->ApplyProperty(property, oldValue);
+ item->ApplyProperty(property, oldValue);
item->Modify();
-
+
UpdateItem();
wxString menuLabel(_T("Change ") + property->GetName());
-
+
// This won't do anything first time Do is applied,
// since we've already done the action for this property.
// But when we Undo or Redo, the changed properties will be applied.
AddControls(this, msg);
Centre();
}
-
+
bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
{
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
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 );
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
item3->SetFocus();
((wxButton*) FindWindow(wxID_OK))->SetDefault();
- parent->SetAutoLayout( true );
parent->SetSizer(item0);
item0->Fit(parent);
*/
void ctSettingsDialog::CreateControls()
-{
+{
////@begin ctSettingsDialog content construction
ctSettingsDialog* item1 = this;
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
- item1->SetAutoLayout(true);
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
*/
void ctGeneralSettingsDialog::CreateControls()
-{
+{
////@begin ctGeneralSettingsDialog content construction
ctGeneralSettingsDialog* item4 = this;
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
item4->SetSizer(item5);
- item4->SetAutoLayout(true);
wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings"));
wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL);
*/
void ctLocationSettingsDialog::CreateControls()
-{
+{
////@begin ctLocationSettingsDialog content construction
ctLocationSettingsDialog* item11 = this;
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
item11->SetSizer(item12);
- item11->SetAutoLayout(true);
wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations"));
wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL);
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
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"));
#if wxUSE_TOOLTIPS
if (ShowToolTips())
// Make a panel
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 );
}
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
- SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
long style)
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
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));
if ( !!className )
wxPanel::AddChild(child);
- m_controlAdded = TRUE;
+ m_controlAdded = true;
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
- SetAutoLayout(TRUE);
Layout();
}
{
delete m_lib;
m_lib = NULL;
- return FALSE;
+ return false;
}
DLL_WidgetFactory_t factory;
{
delete m_lib;
m_lib = NULL;
- return FALSE;
+ return false;
}
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
delete m_lib;
m_lib = NULL;
m_widget = NULL;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void wxDllWidget::UnloadWidget()
{
public:
MyWindow(wxWindow *parent, long style)
- : wxWindow(parent, -1) {}
+ : wxWindow(parent, wxID_ANY) {}
int HandleCommand(int cmd, const wxString& param)
{
{
public:
wxDllWidget(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
const wxString& dllName = wxEmptyString,
const wxString& className = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
{ \
*classInst = new widget(parent, style); \
*cmdFunc = SendCommandTo##widget; \
- return TRUE; \
+ return true; \
}
#define END_WIDGET_LIBRARY() \
- return FALSE; \
+ return false; \
}
#endif // __DLLWIDGET_H__
{
public:
TestWindow(wxWindow *parent, long style)
- : wxWindow(parent, -1)
+ : wxWindow(parent, wxID_ANY)
{
SetBackgroundColour(wxColour("white"));
}