; ĴBc@sdkZdkZdkZdeifdYZdeifdYZdZdZe djoPdk Z dk Z dk Z e i de iie id ge id ndS( NsMyFramecBstZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZRS(NcCsHtii|||ddddf||_|i|i|i dti |dddti ti B} ti} ti}|id d d |id d d|iddd|i|iddd| i|dti}|idd|iddti}|idd|idd|idd|id d!|| i|d"ti}|id#d$d%ti|id&d'd(ti|id)d*d+ti|i|id,d-dti|id.d/dti| i|d0ti} | id1d2d3ti| id4d5d6ti| id7d8d9ti| i| d:ti} ti| d;d<d=}|it i!| i"|| id>d?d@| i| idAdB| i| idCdDti} | idEdF| idGdH| | idIdJ| idKdL| idMdN| idOdP| i| dQ|i$| |i%ti&|i'|i%ti(|i)dRd |i%ti(|i*dRd |i%ti(|i+dRd|i%ti(|i,dRd|i%ti(|i-dRd|i%ti(|i.dRd|i%ti(|i/dRd|i%ti(|i0dRd|i%ti(|i1dRd|i%ti(|i2dRd#|i%ti(|i2dRd&|i%ti(|i2dRd)|i%ti(|i3dRd,|i%ti(|i4dRd.|i%ti5|i6dRd1dSd7|i%ti(|i7dRd;|i%ti(|i8dRd>|i%ti(|i9dRdA|i%ti(|i:dRdC|i%ti(|i;dRdI|i%ti(|i<dRdM|i%ti(|i<dRdOti=i%ti>|i?dRdKdS(TNsPlaying with menusssizeiisThis is the statusbaris A bunch of bogus menus have been created for this frame. You can play around with them to see how they behave and then check the source for this sample to see how to implement them. sstyleies&MercurysThis the text in the Statusbarifs&Venussigs&EarthsYou may select Earth tooihs&ClosesClose this frames&PlanetsisHydrogenisHeliumis LanthaniumisCeriumis Praseodymiumis Lanthanidess &Elementsi-sIDLEs"a Python shell using tcl/tk as GUIi.sPyCrusts$a Python shell using wxPython as GUIi/spsis+a simple Python shell using wxPython as GUIi0sproject1i1sproject2s&Shellsisletterssabcde...isdigitss123...isletters and digitssabcd... + 123...sChec&kis&Smile! Ctrl+SsThis one has an iconisInteresting thing Ctrl+AsNote the shortcut!is Hello Shift+Hisremove the submenuiYs Submenu Itemissubmenuisremove this menuisthis is updatedisinsert after this...is...and before thiss&Funsidsid2(@swxsFrames__init__sselfsparentsidslogsCenterOnScreensCreateStatusBars SetStatusTextsTextCtrls TE_READONLYs TE_MULTILINEstcsMenuBarsmenuBarsMenusmenu1sAppendsAppendSeparatorsmenu2ssubmenus AppendMenusmenu3s ITEM_RADIOs ITEM_NORMALsmenu4s ITEM_CHECKsmenu5sMenuItemsitems SetBitmapsimagessgetSmilesBitmaps AppendItemsmenu6s SetMenuBarsBindsEVT_MENU_HIGHLIGHT_ALLsOnMenuHighlightsEVT_MENUsMenu101sMenu102sMenu103s CloseWindowsMenu201sMenu202sMenu2031sMenu2032sMenu2033s Menu301To303sMenu304sMenu305sEVT_MENU_RANGEs Menu401To403sMenu500sMenu501sMenu502s TestRemoves TestRemove2s TestInsertsGetApps EVT_UPDATE_UIs TestUpdateUI(sselfsparentsidslogssubmenusitemsmenu2smenu3smenu1smenu6smenu4smenu5smenuBarstc((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys__init__s%                   "cCsR|i}|ii|}|o|i}|i }n|i dS(N( sevents GetMenuIdsidsselfs GetMenuBars FindItemByIdsitemsGetTextstextsGetHelpshelpsSkip(sselfseventshelpstextsidsitem((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysOnMenuHighlights   cCs|iiddS(NsWelcome to Mercury (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu101scCs|iiddS(NsWelcome to Venus (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu102scCs|iiddS(NsWelcome to the Earth (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu103scCs|idS(N(sselfsClose(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys CloseWindowscCs|iiddS(NsChemical element number 1 (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu201scCs|iiddS(NsChemical element number 2 (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu202scCs|iiddS(NsElement number 57 (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu2031scCs|iiddS(NsElement number 58 (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu2032scCs|iiddS(NsElement number 59 (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu2033scCs$|i}|iid|dS(Ns Event id: %d (seventsGetIdsidsselfslogswrite(sselfseventsid((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys Menu301To303s cCs|iiddS(NsNot yet available (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu304scCs|iiddS(Ns Still vapour (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu305scCs|iiddS(NsFrom a EVT_MENU_RANGE event (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys Menu401To403scCs|iiddS(NsHave a happy day! (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu500scCs|iiddS(Ns4Look in the code how the shortcut has been realized (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu501scCs|iiddS(NsHello from Jean-Michel (sselfslogswrite(sselfsevent((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMenu502scCs]|i}|id}| odSn|i}|i}|i |iddS(NiYi( sselfs GetMenuBarsmbs FindItemByIds submenuItemsGetMenussubmenus GetParentsmenus RemoveItem(sselfsevtssubmenusmbs submenuItemsmenu((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys TestRemoves   cCs|i}|iddS(Ni(sselfs GetMenuBarsmbsRemove(sselfsevtsmb((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys TestRemove2s cCsti}|i|dS(N(stimesctimestextsevtsSetText(sselfsevtstext((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys TestUpdateUIs c Csd}|i}|i|}|i}d}x6|i D](}|i |joPn|d7}q@Wt i } t i|}|i| |idt| |i||dS(NiiisNewItem (stheIDsselfs GetMenuBarsmbs FindItemByIdsmenuItemsGetMenusmenusposs GetMenuItemssisGetIdswxsNewIdsIDsMenuItemsitemsSetIdsSetTextsstrs InsertItem( sselfsevtsmbsismenustheIDspossitemsmenuItemsID((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys TestInserts     (s__name__s __module__s__init__sOnMenuHighlightsMenu101sMenu102sMenu103s CloseWindowsMenu201sMenu202sMenu2031sMenu2032sMenu2033s Menu301To303sMenu304sMenu305s Menu401To403sMenu500sMenu501sMenu502s TestRemoves TestRemove2s TestUpdateUIs TestInsert(((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysMyFrames, s                   s TestPanelcBstZdZdZRS(NcCsZ||_tii||dti|ddddf}|iti |i |dS(NisShow the Menu samplei2( slogsselfswxsPanels__init__sparentsButtonsbsBinds EVT_BUTTONsOnButton(sselfsparentslogsb((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys__init__s cCs&t|d|i}|itdS(Ni(sMyFramesselfslogswinsShowsTrue(sselfsevtswin((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysOnButton s(s__name__s __module__s__init__sOnButton(((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys TestPanels cCst||}|SdS(N(s TestPanelsnbslogswin(sframesnbslogswin((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pysrunTestss~A demo of using wx.MenuBar and wx.Menu in various ways. A menu is a popup (or pull down) list of items, one of which may be selected before the menu goes away (clicking elsewhere dismisses the menu). Menus may be used to construct either menu bars or popup menus. A menu item has an integer ID associated with it which can be used to identify the selection, or to change the menu item in some way. A menu item with a special identifier -1 is a separator item and doesn't have an associated command but just makes a separator line appear in the menu. Menu items may be either normal items, check items or radio items. Normal items don't have any special properties while the check items have a boolean flag associated to them and they show a checkmark in the menu when the flag is set. wxWindows automatically toggles the flag value when the item is clicked and its value may be retrieved using either IsChecked method of wx.Menu or wx.MenuBar itself or by using wxEvent.IsChecked when you get the menu notification for the item in question. The radio items are similar to the check items except that all the other items in the same radio group are unchecked when a radio item is checked. The radio group is formed by a contiguous range of radio items, i.e. it starts at the first item of this kind and ends with the first item of a different kind (or the end of the menu). Notice that because the radio groups are defined in terms of the item positions inserting or removing the items in the menu containing the radio items risks to not work correctly. Finally note that the radio items are only supported under Windows and GTK+ currently. s__main__sii(stimeswxsimagessFramesMyFramesPanels TestPanelsrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv( ssyssrunsoverviewsrunTeststimesimagesswxsossMyFrames TestPanel((sd/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Menu.pys?s