wxWidgets


Home
SQL Structure
Program ettiquette
Class Structure
class struct.htm
wxWidgets  

Adding a dialog

Adding a Dialog box is fairly simple. Here are the steps.
 

  1. create a new IF_MY_DLG.h and IF_MY_DLG.cpp. Each dialog should have it's own set of
    files.
     
  2. Copy App 1 into the .h file. Change the my_dlg to <whatever>_dlg
     
  3. In IF_Master.h add  #include "IF_MY_DLG.h"
     
  4. Copy App 2 into the .CPP file. Edit my.dlg etc.
     
  5. Add your events etc ... See next sections.
     



App 1

class my_dlg : public wxDialog
{
public:
        my_dlg(wxWindow *parent);

protected:
              
      void mySelect(wxCommandEvent &event);
      void my_dlg::OnText(wxCommandEvent &event);

private:
DECLARE_EVENT_TABLE()  // important .. don't delete

// Dialog text field vars. To save data to.
      wxTextCtrl *text1;
      wxTextCtrl *text2;

// ID's for above.
enum
{
      ID_TEXT1,
      ID_TEXT2                
};
};

#endif


APP 2

MY_dlg::MY_dlg(wxWindow *parent) : wxDialog(NULL, -1, "sql_connect_Dialog",
                                wxDefaultPosition, wxSize(600, 600) )


void my_dlg::OnText(wxCommandEvent &event)
{
 wxLogMessage("You've selected item: " + event.GetString());
}

BEGIN_EVENT_TABLE(my_dlg, wxDialog)
 EVT_TEXT(ID_TEXT1, OnText)
 EVT_TEXT(ID_TEXT2, OnText)
END_EVENT_TABLE()


wxLog.

There are a few wxLog functions that i think we should use for our logging.

  • wxLogError.
  • wxLogwarning
  • wxLogMessage.

These provide global log messages that you can send to a text file.


Home | FAQ | Program | About Me

 Copyright or other proprietary statement goes here.
For problems or questions regarding this Web site contact [ProjectEmail].
Last updated: 04-Dec-2005.