wx.SampleDialogs.MyModalDialog Class Reference

List of all members.

Public Member Functions

 MyModalDialog (Window parent)
void OnButton (object sender, Event e)

Public Attributes

Button m_btnDelete
Button m_btnFocused


Detailed Description

Definition at line 914 of file Dialogs.cs.


Constructor & Destructor Documentation

wx.SampleDialogs.MyModalDialog.MyModalDialog ( Window  parent  ) 

Definition at line 919 of file Dialogs.cs.

00920                         : base(parent, -1, "Modal dialog")
00921                 {
00922                         BoxSizer sizerTop = new BoxSizer(Orientation.wxHORIZONTAL);
00923 
00924                         m_btnFocused = new Button(this, -1, "Default button");
00925                         m_btnDelete = new Button(this, -1, "&Delete button");
00926                         Button btnOk = new Button(this, wxID_CANCEL, "&Close");
00927                         sizerTop.Add(m_btnFocused, 0, wx.SizerFlag.wxALIGN_CENTER | wx.SizerFlag.wxALL, 5);
00928                         sizerTop.Add(m_btnDelete, 0, wx.SizerFlag.wxALIGN_CENTER | wx.SizerFlag.wxALL, 5);
00929                         sizerTop.Add(btnOk, 0, wx.SizerFlag.wxALIGN_CENTER | wx.SizerFlag.wxALL, 5);
00930 
00931                         AutoLayout = true;
00932                         SetSizer(sizerTop);
00933 
00934                         sizerTop.SetSizeHints(this);
00935                         sizerTop.Fit(this);
00936 
00937                         m_btnFocused.SetFocus();
00938                         m_btnFocused.SetDefault();
00939 
00940                         EVT_BUTTON(-1, new EventListener(OnButton));
00941                 }


Member Function Documentation

void wx.SampleDialogs.MyModalDialog.OnButton ( object  sender,
Event  e 
)

Definition at line 943 of file Dialogs.cs.

00944                 {
00945                         CommandEvent ce = (CommandEvent) e;
00946 
00947                         if ( ce.EventObject == m_btnDelete )
00948                         {
00949                                 //m_btnFocused = null;
00950                                 m_btnDelete.Disable();
00951                                 m_btnFocused.Hide();
00952                         }
00953                         else if (ce.EventObject == m_btnFocused )
00954                         {
00955                                 new GetTextFromUser("Dummy prompt",
00956                                         "Modal dialog called from dialog",
00957                                         "", this);
00958                         }
00959                         else
00960                         {
00961                                 e.Skip();
00962                         }
00963                 }


Member Data Documentation

Button wx.SampleDialogs.MyModalDialog.m_btnDelete

Definition at line 917 of file Dialogs.cs.

Button wx.SampleDialogs.MyModalDialog.m_btnFocused

Definition at line 916 of file Dialogs.cs.


Manual of the wx.NET   (c) 2003-2010 the wx.NET project