void OnEnableAll(wxCommandEvent& event);
void OnChangeColour(wxCommandEvent& event);
void OnTestButton(wxCommandEvent& event);
+ void OnBmpButton(wxCommandEvent& event);
wxListBox *m_listbox,
*m_listboxSorted;
frame->SetMenuBar(menu_bar);
frame->Show(TRUE);
- frame->SetCursor(wxCursor(wxCURSOR_HAND));
//frame->GetPanel()->m_notebook->SetSelection(6);
const int ID_BUTTON_TEST1 = 190;
const int ID_BUTTON_TEST2 = 191;
+const int ID_BITMAP_BTN = 192;
const int ID_CHANGE_COLOUR = 200;
EVT_CHECKBOX (ID_CHANGE_COLOUR, MyPanel::OnChangeColour)
EVT_BUTTON (ID_BUTTON_TEST1, MyPanel::OnTestButton)
EVT_BUTTON (ID_BUTTON_TEST2, MyPanel::OnTestButton)
+EVT_BUTTON (ID_BITMAP_BTN, MyPanel::OnBmpButton)
END_EVENT_TABLE()
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
#endif // wxUSE_TOOLTIPS
(void)new wxCheckBox( panel, ID_CHANGE_COLOUR, "&Toggle colour",
wxPoint(110,170) );
+ panel->SetCursor(wxCursor(wxCURSOR_HAND));
m_notebook->AddPage(panel, "wxListBox", TRUE, Image_List);
panel = new wxPanel(m_notebook);
dc.DrawText("Bitmap", 30, 40);
dc.SelectObject( wxNullBitmap );
- (void)new wxBitmapButton(panel, -1, bitmap, wxPoint(100, 20));
+ (void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20));
#ifdef __WXMSW__
// test for masked bitmap display
event.GetId() == ID_BUTTON_TEST1 ? _T('1') : _T('2'));
}
+void MyPanel::OnBmpButton(wxCommandEvent& event)
+{
+ wxLogMessage(_T("Bitmap button clicked."));
+}
+
void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event))
{
static wxColour s_colOld;
{
wxBusyCursor bc;
-#if 0 // VZ: my temp test code, will remove
+#if 1 // VZ: my temp test code, will remove
wxGetTextFromUser("msg", "caption", "val", this);
return;
#endif // 0
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+ // create the listbox in which we will show misc messages as they come
+ m_listbox = new wxListBox(this, -1);
+
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar();
- SetStatusText(_T("Welcome to wxWindows!"));
+ SetStatusText(_T("Welcome to wxWindows exec sample!"));
#endif // wxUSE_STATUSBAR
}
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
// The `main program' equivalent, creating the windows and returning the
// main frame
-bool MyApp::OnInit(void)
+bool MyApp::OnInit()
{
// Create the mini frame window
mini_frame = new MyMiniFrame((wxFrame *) NULL, -1, "wxMiniFrame sample",
mini_frame->CreateToolBar(wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
InitToolbar(mini_frame->GetToolBar());
-
+
// Create the main frame window
main_frame = new MyMainFrame((wxFrame *) NULL, -1, "wxFrame sample",
wxPoint(100, 100), wxSize(300, 200));
-
+
main_frame->CreateToolBar(wxNO_BORDER|wxTB_VERTICAL, ID_TOOLBAR);
InitToolbar(main_frame->GetToolBar());
-
+
button = new wxButton( main_frame, ID_REPARENT, "Press to reparent!" );
#ifdef __WXMSW__
#endif
SetTopWindow(main_frame);
-
+
main_frame->Show(TRUE);
mini_frame->Show(TRUE);
toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help");
toolBar->Realize();
-
+
toolBar->EnableTool( wxID_HELP, FALSE );
// Can delete the bitmaps since they're reference counted
// after closing the mini_frame. We'll have the last laugh.
if (! mini_frame_exists)
wxMessageBox("The miniframe no longer exists.\n"
- "You don't want to make this button an orphan, do you?",
- "You got to be kidding");
+ "You don't want to make this button an orphan, do you?",
+ "You got to be kidding");
else
button->Reparent( mini_frame );
}
static struct BugsGridData
{
int id;
-
- // Borland can't deal with global wxStrings and will generate a
- // compile time error with the initializing the gs_dataGridBugs
- // array (below)
- //
-#ifndef __BORLANDC__
- wxString summary;
-#else
- wxChar *summary;
-#endif
-
+ wxChar summary[80];
Severity severity;
int prio;
-
-#ifndef __BORLANDC__
- wxString platform;
-#else
- wxChar *platform;
-#endif
-
+ wxChar platform[12];
bool opened;
} gs_dataBugsGrid [] =
{
break;
case Col_Summary:
-#ifndef __BORLANDC__
- gd.summary = value;
-#else
- // this generates a warning message if you are using the
- // memory tracing code but it should be ok :MB
- //
- delete gd.summary;
- gd.summary = copystring( value.c_str() );
-#endif
+ wxStrncpy(gd.summary, value, WXSIZEOF(gd.summary));
break;
case Col_Platform:
-#ifndef __BORLANDC__
- gd.platform = value;
-#else
- // this generates a warning message if you are using the
- // memory tracing code but it should be ok :MB
- //
- delete gd.platform;
- gd.platform = copystring( value.c_str() );
-#endif
+ wxStrncpy(gd.platform, value, WXSIZEOF(gd.platform));
break;
}
}