nobody at rubyforge.org
2007-Mar-29 18:51 UTC
[Wxruby-development] [926] branches/wxruby2/wxwidgets_282: Update Dialog wx2.6 -> wx2.8 API, remove deprecations and cruft, update doc
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[926] branches/wxruby2/wxwidgets_282: Update Dialog wx2.6 -> wx2.8 API, remove deprecations and cruft, update doc</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>926</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-03-29 14:51:36 -0400 (Thu, 29 Mar 2007)</dd> </dl> <h3>Log Message</h3> <pre>Update Dialog wx2.6 -> wx2.8 API, remove deprecations and cruft, update doc</pre> <h3>Modified Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282doctextiledialogtxtl">branches/wxruby2/wxwidgets_282/doc/textile/dialog.txtl</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesincludewxDialogh">branches/wxruby2/wxwidgets_282/swig/classes/include/wxDialog.h</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282doctextiledialogtxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/dialog.txtl (925 => 926)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/dialog.txtl        2007-03-28 17:28:48 UTC (rev 925) +++ branches/wxruby2/wxwidgets_282/doc/textile/dialog.txtl        2007-03-29 18:51:36 UTC (rev 926) </span><span class="lines">@@ -19,8 +19,24 @@ </span><span class="cx"> </span><span class="cx"> "Object":object.html </span><span class="cx"> </span><del>-h2. Remarks </del><ins>+h2. Dialog Buttons </ins><span class="cx"> </span><ins>+The dialog usually contains either a single button allowing to close the +dialog or two buttons, one accepting the changes and the other one +discarding them (such button, if present, is automatically activated if +the user presses the @"Esc"@ key). By default, buttons with the standard +@ID_OK@ and @ID_CANCEL@ identifiers behave as expected. It is also +possible to use a button with a different identifier nstead, see +"set_affirmative_id":#Dialog_setaffirmativeid and +"set_escape_id":#Dialog_setescapeid. + +Also notice that the "create_button_sizer()":#Dialog_createbuttonsizer() +should be used to create the buttons appropriate for the current platform and +positioned correctly (including their order which is +platform-dependent). + +h2. Modal and modeless dialogs + </ins><span class="cx"> There are two kinds of dialog -- _modal_ and _modeless_. A modal dialog </span><span class="cx"> blocks program flow and user input on other windows until it is dismissed, </span><span class="cx"> whereas a modeless dialog behaves more like a frame in that program flow </span><span class="lines">@@ -56,8 +72,8 @@ </span><span class="cx"> |@THICK_FRAME@|Display a thick frame around the window.| </span><span class="cx"> |@STAY_ON_TOP@|The dialog stays on top of all other windows.| </span><span class="cx"> |@NO_3D@|Under Windows, specifies that the child controlsshould not have 3D borders unless specified in the control.| </span><del>-|@DIALOG_NO_PARENT@|By default, a dialog created with a @nil@ parent window will be given the "application''s top level window":appgettopwindow.html as parent. Use thisstyle to prevent this from happening and create an orphan dialog. This is not recommended for modal dialogs.| -|@DIALOG_EX_CONTEXTHELP@|Under Windows, puts a query button on thecaption. When pressed, Windows will go into a context-sensitive help mode and Widgets will senda EVT_HELP event if the user clicked on an application window. _Note_\ that this is an extendedstyle and must be set by calling "set_extra_style":#Dialog_setextrastyle before Create is called (two-step construction).| </del><ins>+|@DIALOG_NO_PARENT@|By default, a dialog created with a @nil@ parent window will be given the "application''s top level window":app.html as parent. Use thisstyle to prevent this from happening and create an orphan dialog. This is not recommended for modal dialogs.| +|@DIALOG_EX_CONTEXTHELP@|Under Windows, puts a query button on thecaption. When pressed, Windows will go into a context-sensitive help mode and Widgets will senda EVT_HELP event if the user clicked on an application window. _Note_ that this is an extendedstyle and must be set by calling "set_extra_style":#Dialog_setextrastyle before Create is called (two-step construction).| </ins><span class="cx"> |@DIALOG_EX_METAL@|On Mac OS X, frames with this style will be shown with a metallic look. This is an _extra_ style.| </span><span class="cx"> </span><span class="cx"> </span><span class="lines">@@ -79,32 +95,31 @@ </span><span class="cx"> * "Dialog#centre":#Dialog_centre </span><span class="cx"> * "Dialog#create":#Dialog_create </span><span class="cx"> * "Dialog#create_button_sizer":#Dialog_createbuttonsizer </span><ins>+* "Dialog#create_separated_button_sizer":#Dialog_createseparatedbuttonsizer </ins><span class="cx"> * "Dialog#create_std_dialog_button_sizer":#Dialog_createstddialogbuttonsizer </span><span class="cx"> * "Dialog#do_ok":#Dialog_dook </span><span class="cx"> * "Dialog#end_modal":#Dialog_endmodal </span><span class="cx"> * "Dialog#get_affirmative_id":#Dialog_getaffirmativeid </span><ins>+* "Dialog#get_escape_id":#Dialog_getescapeid </ins><span class="cx"> * "Dialog#get_return_code":#Dialog_getreturncode </span><del>-* "Dialog#get_title":#Dialog_gettitle </del><span class="cx"> * "Dialog#get_tool_bar":#Dialog_gettoolbar </span><span class="cx"> * "Dialog#iconize":#Dialog_iconize </span><span class="cx"> * "Dialog#is_iconized":#Dialog_isiconized </span><span class="cx"> * "Dialog#is_modal":#Dialog_ismodal </span><del>-* "Dialog#on_apply":#Dialog_onapply -* "Dialog#on_cancel":#Dialog_oncancel -* "Dialog#on_ok":#Dialog_onok </del><span class="cx"> * "Dialog#on_sys_colour_changed":#Dialog_onsyscolourchanged </span><span class="cx"> * "Dialog#set_affirmative_id":#Dialog_setaffirmativeid </span><ins>+* "Dialog#set_escape_id":#Dialog_setescapeid </ins><span class="cx"> * "Dialog#set_icon":#Dialog_seticon </span><span class="cx"> * "Dialog#set_icons":#Dialog_seticons </span><span class="cx"> * "Dialog#set_modal":#Dialog_setmodal </span><span class="cx"> * "Dialog#set_return_code":#Dialog_setreturncode </span><del>-* "Dialog#set_title":#Dialog_settitle </del><span class="cx"> * "Dialog#show":#Dialog_show </span><span class="cx"> * "Dialog#show_modal":#Dialog_showmodal </span><span class="cx"> </span><span class="cx"> </div> </span><span class="cx"> </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_new). Dialog.new </span><span class="cx"> </span><span class="cx"> *Dialog.new*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% title, </span><span class="lines">@@ -133,10 +148,12 @@ </span><span class="cx"> </span><span class="cx"> "Dialog#create":dialog.html#Dialog_create </span><span class="cx"> </span><ins>+ </ins><span class="cx"> *destructor*() </span><span class="cx"> </span><span class="cx"> Destructor. Deletes any child windows before deleting the physical window. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_centre). Dialog#centre </span><span class="cx"> </span><span class="cx"> *centre*(%(arg-type)Integer% direction = BOTH) </span><span class="lines">@@ -147,6 +164,7 @@ </span><span class="cx"> </span><span class="cx"> * _direction_ May be @HORIZONTAL@, @VERTICAL@ or @BOTH@. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_create). Dialog#create </span><span class="cx"> </span><span class="cx"> Boolean *create*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% title, </span><span class="lines">@@ -157,6 +175,7 @@ </span><span class="cx"> </span><span class="cx"> Used for two-step dialog box construction. See "Dialog.new":dialog.html#Dialog_new for details. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_createbuttonsizer). Dialog#create_button_sizer </span><span class="cx"> </span><span class="cx"> "Sizer":sizer.html *create_button_sizer*(%(arg-type)Integer% flags) </span><span class="lines">@@ -166,8 +185,25 @@ </span><span class="cx"> </span><span class="cx"> The sizer lays out the buttons in a manner appropriate to the platform. </span><span class="cx"> </span><del>-This function simply calls "create_std_dialog_button_sizer":#Dialog_createstddialogbuttonsizer. </del><ins>+This function uses "create_std_dialog_button_sizer":#Dialog_createstddialogbuttonsizer +internally for most platforms but doesn''t create the sizer at all for the +platforms with hardware buttons (such as smartphones) for which it sets up the +hardware buttons appropriately and returns , so don''t forget to test that +the return value is valid before using it. </ins><span class="cx"> </span><ins>+ +h3(#Dialog_createseparatedbuttonsizer). Dialog#create_separated_button_sizer + + "Sizer":sizer.html *create_separated_button_sizer*(%(arg-type)Integer% flags) + +Creates a sizer with standard buttons using +"create_button_sizer":#Dialog_createbuttonsizer separated from the rest +of the dialog contents by a horizontal "StaticLine":staticline.html. + +Please notice that just like CreateButtonSizer() this function may return +if no buttons were created. + + </ins><span class="cx"> h3(#Dialog_createstddialogbuttonsizer). Dialog#create_std_dialog_button_sizer </span><span class="cx"> </span><span class="cx"> "StdDialogButtonSizer":stddialogbuttonsizer.html *create_std_dialog_button_sizer*(%(arg-type)Integer% flags) </span><span class="lines">@@ -177,6 +213,7 @@ </span><span class="cx"> </span><span class="cx"> The sizer lays out the buttons in a manner appropriate to the platform. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_dook). Dialog#do_ok </span><span class="cx"> </span><span class="cx"> Boolean *do_ok*() </span><span class="lines">@@ -186,6 +223,7 @@ </span><span class="cx"> default. You can override this function. If the function returns false, Widgets </span><span class="cx"> will call Close() for the dialog. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_endmodal). Dialog#end_modal </span><span class="cx"> </span><span class="cx"> *end_modal*(%(arg-type)Integer% retCode) </span><span class="lines">@@ -200,16 +238,31 @@ </span><span class="cx"> </span><span class="cx"> "Dialog#show_modal":dialog.html#Dialog_showmodal, "Dialog#get_return_code":dialog.html#Dialog_getreturncode, "Dialog#set_return_code":dialog.html#Dialog_setreturncode </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_getaffirmativeid). Dialog#get_affirmative_id </span><span class="cx"> </span><span class="cx"> Integer *get_affirmative_id*() </span><span class="cx"> </span><del>-Gets the identifier to be used when the user presses an OK button in a PocketPC titlebar. </del><ins>+Gets the identifier of the button which works like standard OK button in this +dialog. </ins><span class="cx"> </span><span class="cx"> h4. See also </span><span class="cx"> </span><span class="cx"> "Dialog#set_affirmative_id":dialog.html#Dialog_setaffirmativeid </span><span class="cx"> </span><ins>+ +h3(#Dialog_getescapeid). Dialog#get_escape_id + + Integer *get_escape_id*() + +Gets the identifier of the button to map presses of @ESC@ +button to. + +h4. See also + +"Dialog#set_escape_id":dialog.html#Dialog_setescapeid + + </ins><span class="cx"> h3(#Dialog_getreturncode). Dialog#get_return_code </span><span class="cx"> </span><span class="cx"> Integer *get_return_code*() </span><span class="lines">@@ -225,12 +278,7 @@ </span><span class="cx"> </span><span class="cx"> "Dialog#set_return_code":dialog.html#Dialog_setreturncode, "Dialog#show_modal":dialog.html#Dialog_showmodal, "Dialog#end_modal":dialog.html#Dialog_endmodal </span><span class="cx"> </span><del>-h3(#Dialog_gettitle). Dialog#get_title </del><span class="cx"> </span><del>- String *get_title*() - -Returns the title of the dialog box. - </del><span class="cx"> h3(#Dialog_gettoolbar). Dialog#get_tool_bar </span><span class="cx"> </span><span class="cx"> "ToolBar":toolbar.html *get_tool_bar*() </span><span class="lines">@@ -241,6 +289,7 @@ </span><span class="cx"> </span><span class="cx"> This function is not available on any other platform. </span><span class="cx"> </span><ins>+ </ins><span class="cx"> h3(#Dialog_iconized). Dialog#iconize </span><span class="cx"> </span><span class="cx"> *iconize*(%(arg-type)Boolean% iconize) </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesincludewxDialogh"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/classes/include/wxDialog.h (925 => 926)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/include/wxDialog.h        2007-03-28 17:28:48 UTC (rev 925) +++ branches/wxruby2/wxwidgets_282/swig/classes/include/wxDialog.h        2007-03-29 18:51:36 UTC (rev 926) </span><span class="lines">@@ -1,165 +1,34 @@ </span><del>-// wxDialog.h -// This file was automatically generated -// by extractxml.rb, part of the wxRuby project -// Do not make changes directly to this file! </del><ins>+// Copyright 2004-2007 by Kevin Smith +// released under the MIT-style wxruby2 license </ins><span class="cx"> </span><span class="cx"> #if !defined(_wxDialog_h_) </span><span class="cx"> #define _wxDialog_h_ </span><ins>+ </ins><span class="cx"> class wxDialog : public wxDialogBase </span><span class="cx"> { </span><span class="cx"> public: </span><del>-        /** -         * \brief Default constructor. -        */ - </del><span class="cx"> wxDialog() ; </span><del>-        /** -         * \brief Constructor. -         * \param wxWindow* -         * \param wxWindowID -         * \param const wxString& -         * \param const wxPoint& -         * \param const wxSize& -         * \param long -         * \param const wxString& -        */ - </del><span class="cx"> wxDialog(wxWindow* parent , wxWindowID id , const wxString& title , const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("dialogBox")) ; </span><del>-        /** -         * \brief Destructor. Deletes any child windows before deleting the physical window. -        */ - </del><span class="cx"> virtual ~wxDialog() ; </span><del>-        /** -         * \brief Centres the dialog box on the display. -         * \param int -        */ - </del><span class="cx"> void Centre(int direction = wxBOTH) ; </span><del>-        /** -         * \brief Used for two-step dialog box construction. See -for details. -         * \param wxWindow* -         * \param wxWindowID -         * \param const wxString& -         * \param const wxPoint& -         * \param const wxSize& -         * \param long -         * \param const wxString& -        */ - </del><span class="cx"> bool Create(wxWindow* parent , wxWindowID id , const wxString& title , const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("dialogBox")) ; </span><del>-        /** -         * \brief Ends a modal dialog, passing a value to be returned from the -invocation. -         * \param int -        */ - </del><ins>+ wxSizer* CreateButtonSizer(long flags); + wxSizer* CreateSeparatedButtonSizer(long flags); + wxStdDialogButtonSizer* CreateStdDialogButtonSizer(long flags); </ins><span class="cx"> virtual void EndModal(int retCode ) ; </span><del>-        /** -         * \brief -        */ - </del><ins>+ int GetAffirmativeId() const; + int GetEscapeId() const; </ins><span class="cx"> int GetReturnCode() ; </span><del>-        /** -         * \brief Returns the title of the dialog box. -        */ - - wxString GetTitle() const; -        /** -         * \brief Iconizes or restores the dialog. Windows only. -         * \param const bool -        */ - </del><span class="cx"> void Iconize(const bool iconize ) ; </span><del>-        /** -         * \brief Returns true if the dialog box is iconized. Windows only. -        */ - </del><span class="cx"> bool IsIconized() const; </span><del>-        /** -         * \brief Returns true if the dialog box is modal, false otherwise. -        */ - </del><span class="cx"> virtual bool IsModal() const; </span><del>-        /** -         * \brief This member is called to allow the window to intercept keyboard events -before they are processed by child windows. -         * \param wxKeyEvent& -        */ - - //virtual void OnCharHook(wxKeyEvent& event ); -        /** -         * \brief -         * \param wxCommandEvent& -        */ - - //virtual void OnApply(wxCommandEvent& event ) ; -        /** -         * \brief -         * \param wxCommandEvent& -        */ - - //virtual void OnCancel(wxCommandEvent& event ) ; -        /** -         * \brief -         * \param wxCommandEvent& -        */ - - //virtual void OnOK(wxCommandEvent& event ) ; -        /** -         * \brief The default handler for wxEVT_SYS_COLOUR_CHANGED. -         * \param wxSysColourChangedEvent& -        */ - </del><span class="cx"> //virtual void OnSysColourChanged(wxSysColourChangedEvent& event ) ; </span><del>-        /** -         * \brief Sets the icon for this dialog. - - - - - -See also . -         * \param const wxIcon& -        */ - </del><ins>+ void SetAffirmativeId(int id); + void SetEscapeId(int id); </ins><span class="cx"> void SetIcon(const wxIcon& icon ) ; </span><del>-        /** -         * \brief Sets the icons for this dialog. - - - - - -See also . -         * \param const wxIconBundle& -        */ - </del><span class="cx"> void SetIcons(const wxIconBundle& icons ) ; </span><del>-        /** -         * \brief -         * \param int -        */ - </del><span class="cx"> void SetReturnCode(int retCode ) ; </span><del>-        /** -         * \brief Sets the title of the dialog box. -         * \param const wxString& -        */ - - void SetTitle(const wxString& title ) ; -        /** -         * \brief Hides or shows the dialog. -         * \param const bool -        */ - </del><span class="cx"> virtual bool Show(bool show = true ) ; </span><del>-        /** -         * \brief Shows a modal dialog. Program flow does not return until the dialog has been dismissed with - . -        */ - </del><span class="cx"> virtual int ShowModal() ; </span><span class="cx"> }; </span><span class="cx"> </span></span></pre> </div> </div> </body> </html>
Apparently Analagous Threads
- [883] branches/wxruby2/wxwidgets_282/swig: API changes for move to WxWidgets 2.8
- [898] branches/wxruby2/wxwidgets_282/swig/classes/App.i: Fix init of stock objects for Wx2.8 - was causing infinite loop +crash on OS X
- [924] branches/wxruby2/wxwidgets_282: Changes 2.6 -> 2.8 Wx API; remove deprecated methods and update doc
- [996] branches/wxruby2/wxwidgets_282: TopLevelWindow: add some 2.8 methods; document; add missing CentreOnScreen
- [1081] trunk/wxruby2: Added HyperlinkCtrl from the 2.8 API plus event mappings