├── .gitignore ├── LICENSE.txt ├── README.md ├── examples ├── .gitignore ├── genuimacro │ ├── controlgallery.nim │ ├── nim.cfg │ └── threads.nim └── purewx │ ├── example1.nim │ ├── example2.nim │ └── nim.cfg ├── headers ├── aboutdlg.h ├── any.h ├── anybutton.h ├── app.h ├── arrstr.h ├── bannerwindow.h ├── bitmap.h ├── bmpbuttn.h ├── button.h ├── calctrl.h ├── checkbox.h ├── checklst.h ├── choice.h ├── colordlg.h ├── colour.h ├── combo.h ├── combobox.h ├── commandlinkbutton.h ├── control.h ├── dataobj.h ├── dataview.h ├── datectrl.h ├── datetimectrl.h ├── defs.h ├── dialog.h ├── dirdlg.h ├── event.h ├── filedlg.h ├── font.h ├── fontdata.h ├── fontdlg.h ├── fontenc.h ├── fontenum.h ├── fontpicker.h ├── frame.h ├── gauge.h ├── gdicmn.h ├── hyperlink.h ├── icon.h ├── image.h ├── intl.h ├── kbdstate.h ├── layout.h ├── list.h ├── listbook.h ├── listbox.h ├── listctrl.h ├── menu.h ├── menuitem.h ├── notebook.h ├── object.h ├── ownerdrw.h ├── panel.h ├── position.h ├── radiobox.h ├── radiobut.h ├── richtext │ ├── richtextbackgroundpage.h │ ├── richtextborderspage.h │ ├── richtextbuffer.h │ ├── richtextbulletspage.h │ ├── richtextctrl.h │ ├── richtextdialogpage.h │ ├── richtextfontpage.h │ ├── richtextformatdlg.h │ ├── richtexthtml.h │ ├── richtextimagedlg.h │ ├── richtextindentspage.h │ ├── richtextliststylepage.h │ ├── richtextmarginspage.h │ ├── richtextprint.h │ ├── richtextsizepage.h │ ├── richtextstyledlg.h │ ├── richtextstylepage.h │ ├── richtextstyles.h │ ├── richtextsymboldlg.h │ ├── richtexttabspage.h │ ├── richtextuicustomization.h │ └── richtextxml.h ├── richtooltip.h ├── scrolbar.h ├── scrolwin.h ├── sizer.h ├── slider.h ├── spinbutt.h ├── spinctrl.h ├── statbox.h ├── stattext.h ├── statusbar.h ├── stc.h ├── string.h ├── textctrl.h ├── tglbtn.h ├── toolbar.h ├── treectrl.h ├── types.h ├── variant.h ├── webview.h ├── window.h └── wx.c2nim ├── screenshots ├── linux.png ├── windows.png └── x11.png ├── scripts └── convert.nim ├── wxnim.nimble └── wxnim ├── driver.nim ├── genui.nim ├── private ├── aboutdlg.nim ├── any.nim ├── anybutton.nim ├── app.nim ├── arrstr.nim ├── bannerwindow.nim ├── bitmap.nim ├── bmpbuttn.nim ├── button.nim ├── calctrl.nim ├── checkbox.nim ├── checklst.nim ├── choice.nim ├── colordlg.nim ├── colour.nim ├── combo.nim ├── combobox.nim ├── commandlinkbutton.nim ├── control.nim ├── dataobj.nim ├── dataview.nim ├── datectrl.nim ├── datetimectrl.nim ├── defs.nim ├── dialog.nim ├── dirdlg.nim ├── event.nim ├── filedlg.nim ├── font.nim ├── fontdata.nim ├── fontdlg.nim ├── fontenc.nim ├── fontenum.nim ├── fontpicker.nim ├── frame.nim ├── gauge.nim ├── gdicmn.nim ├── hyperlink.nim ├── icon.nim ├── image.nim ├── intl.nim ├── kbdstate.nim ├── layout.nim ├── list.nim ├── listbook.nim ├── listbox.nim ├── listctrl.nim ├── menu.nim ├── menuitem.nim ├── notebook.nim ├── object.nim ├── ownerdrw.nim ├── panel.nim ├── position.nim ├── radiobox.nim ├── radiobut.nim ├── richtext │ ├── richtextbackgroundpage.nim │ ├── richtextborderspage.nim │ ├── richtextbuffer.nim │ ├── richtextbulletspage.nim │ ├── richtextctrl.nim │ ├── richtextdialogpage.nim │ ├── richtextfontpage.nim │ ├── richtextformatdlg.nim │ ├── richtexthtml.nim │ ├── richtextimagedlg.nim │ ├── richtextindentspage.nim │ ├── richtextliststylepage.nim │ ├── richtextmarginspage.nim │ ├── richtextprint.nim │ ├── richtextsizepage.nim │ ├── richtextstyledlg.nim │ ├── richtextstylepage.nim │ ├── richtextstyles.nim │ ├── richtextsymboldlg.nim │ ├── richtexttabspage.nim │ ├── richtextuicustomization.nim │ └── richtextxml.nim ├── richtextbackgroundpage.nim ├── richtextbuffer.nim ├── richtextbulletspage.nim ├── richtextctrl.nim ├── richtooltip.nim ├── scrolbar.nim ├── scrolwin.nim ├── sizer.nim ├── slider.nim ├── spinbutt.nim ├── spinctrl.nim ├── statbmp.nim ├── statbmpbase.nim ├── statbox.nim ├── stattext.nim ├── statusbar.nim ├── stc.nim ├── string.nim ├── textctrl.nim ├── tglbtn.nim ├── toolbar.nim ├── treectrl.nim ├── types.nim ├── variant.nim ├── webview.nim └── window.nim ├── richtext.nim ├── stc.nim ├── wx.nim └── wxCompile.nim /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andreas Rumpf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.exe.manifest 3 | -------------------------------------------------------------------------------- /examples/genuimacro/controlgallery.nim: -------------------------------------------------------------------------------- 1 | # NOTE: these imports are relative to this folder, this would not be required if wxnim was installed with Nimble 2 | import "../../wxnim/wx", "../../wxnim/genui" 3 | 4 | # Experimental is required for now, this will become default later 5 | #{.experimental: "implicitDeref".} 6 | 7 | var cbChoices = @["Combobox 1", "Combobox 2", "Combobox 3"] 8 | 9 | # This allows us to use these variables before they are declared to create our callbacks 10 | var 11 | spinner: ptr WxSpinCtrl 12 | slider: ptr WxSlider 13 | gauge: ptr WxGauge 14 | 15 | # Callbacks needs to be {.cdecl.} to be passed to the bind function in wxWidgets 16 | proc spinnerCallback(e: var WxSpinEvent) {.cdecl.} = 17 | let val = e.getPosition() 18 | slider.setValue(val) 19 | gauge.setValue(val) 20 | 21 | proc sliderCallback(e: var WxCommandEvent) {.cdecl.} = 22 | let val = e.getInt() 23 | spinner.setValue(val) 24 | gauge.setValue(val) 25 | 26 | # Generate the GUI 27 | genui: 28 | mainFrame % Frame(title = "Hello World"): 29 | Panel | Boxsizer(orient = wxHorizontal): 30 | StaticBox(label = "Basic controls")[proportion = 1] | StaticBoxSizer(orient = wxVertical): 31 | Button: "Button" 32 | CheckBox: "Checkbox" 33 | TextCtrl(value = "Entry") 34 | StaticText: "Label" 35 | Panel[proportion = 2] | Boxsizer(orient = wxVertical): 36 | StaticBox(label = "Numbers") | StaticBoxSizer(orient = wxVertical): 37 | spinner % SpinCtrl(min = 0, max = 100) -> (wxEVT_SPINCTRL, spinnerCallback) 38 | slider % Slider(value = 0, minValue = 0, maxValue = 100) -> (wxEVT_SLIDER, sliderCallback) 39 | gauge % Gauge(range = 100) 40 | StaticBox(label = "Lists") | StaticBoxSizer(orient = wxVertical): 41 | Choice(choices = cbChoices, pos = wxDefaultPosition, size = wxDefaultSize) 42 | ComboBox(choices = cbChoices) 43 | RadioButton(style = wxRB_GROUP): "RadioButton 1" 44 | RadioButton: "RadioButton 2" 45 | RadioButton: "RadioButton 3" 46 | 47 | # Show the main frame and run the main loop 48 | mainFrame.show() 49 | runMainLoop() 50 | -------------------------------------------------------------------------------- /examples/genuimacro/nim.cfg: -------------------------------------------------------------------------------- 1 | @if windows: 2 | --app:gui 3 | @endif 4 | --threads:on 5 | @end 6 | -------------------------------------------------------------------------------- /examples/genuimacro/threads.nim: -------------------------------------------------------------------------------- 1 | import "../../wxnim/wx", "../../wxnim/genui", "../../wxnim/stc" 2 | import os 3 | {.experimental.} 4 | 5 | # Note that explicitly passing channels is not required and you could use a global variable for it 6 | var 7 | thread: Thread[tuple[message: ptr Channel[string], progress: ptr Channel[int]]] 8 | lineChannel: Channel[string] 9 | progressChannel: Channel[int] 10 | 11 | open lineChannel 12 | open progressChannel 13 | 14 | # Create a couple of new custom events so we don't collide with the built-in ones 15 | var 16 | threadEndEvent = wxNewEventType() 17 | threadUpdateEvent = wxNewEventType() 18 | 19 | # Simple template to make event sending a tad easier (note that the ev has to be cloned to be stored outside our local memory) 20 | template sendEvent(window: ptr WxWindow, evType: WxEventType) = 21 | var ev = constructwxThreadEvent(evType) 22 | window.getEventHandler().queueEvent(ev.clone) 23 | 24 | # Define some variables so we can use these in callbacks (alternatively we could forward declare the callbacks and not define these) 25 | var 26 | mainFrame: ptr WxFrame 27 | messageEntry: ptr WxTextCtrl 28 | runButton: ptr WxButton 29 | progressBar: ptr WxGauge 30 | 31 | # Our thread simply echoes out the message from one of the channels. Then does a loop with sleeping, sending an event to update the progress bar. 32 | proc echoAndWait(myChannels: tuple[message: ptr Channel[string], progress: ptr Channel[int]]) {.thread.} = 33 | echo recv myChannels.message 34 | for i in 0..100: 35 | sleep(100) 36 | myChannels.progress.send i 37 | mainFrame.sendEvent(threadUpdateEvent) 38 | mainFrame.sendEvent(threadEndEvent) 39 | 40 | # Run a thread 41 | proc startThreadClick(e: var WxCommandEvent) {.cdecl.} = 42 | discard messageEntry[].enable(false) 43 | discard runButton[].enable(false) 44 | progressBar.setValue(0) 45 | var entryText = messageEntry.getLineText(0) 46 | lineChannel.send $(entryText.cStr.asCstring) 47 | thread.createThread(echoAndWait, (message: lineChannel.addr, progress: progressChannel.addr)) 48 | 49 | # Generate our GUI 50 | genui: 51 | mainFrame%Frame(title = "Threads and events example"): 52 | Panel | Boxsizer(orient=wxVertical): 53 | StaticText: "Please write a message to be echoed by the thread:" 54 | messageEntry % TextCtrl(value = "Hello from thread!") 55 | StaticText: "Thread progress:" 56 | progressBar % Gauge(range = 100) 57 | runButton % Button[flag = wxEXPAND] -> (wxEVT_BUTTON, startThreadClick) : "Run thread!" 58 | StaticBox(label = "Controls to demonstrate the UI doesn't freeze") | StaticBoxSizer(orient = wxVertical): 59 | Slider(value = 0, minValue = 0, maxValue = 100) 60 | Choice(choices = @["These", "Are","Some","Options"], pos = wxDefaultPosition, size = wxDefaultSize) 61 | 62 | # Callbacks can also be created and bound like this 63 | mainFrame[].`bind`(threadEndEvent, proc (e: var WxCommandEvent) {.cdecl.} = 64 | discard messageEntry[].enable(true) 65 | discard runButton[].enable(true) 66 | ) 67 | mainFrame[].`bind`(threadUpdateEvent, proc (e: var WxCommandEvent) {.cdecl.} = 68 | progressBar.setValue(cint(recv progressChannel)) 69 | ) 70 | 71 | mainFrame.show(true) 72 | runMainLoop() 73 | -------------------------------------------------------------------------------- /examples/purewx/example1.nim: -------------------------------------------------------------------------------- 1 | import "../../wxnim/wx" 2 | 3 | proc createFrame(): ptr WxFrame 4 | 5 | let f = createFrame() 6 | 7 | proc handleButtonClick(e: var WxCommandEvent) {.cdecl.} = 8 | f[].setStatusText("Quit called!") 9 | 10 | proc createFrame(): ptr WxFrame = 11 | result = cnew constructWxFrame(nil, wxID_ANY, "Hello World", 12 | constructWxPoint(50, 50), 13 | constructWxSize(450, 340)) 14 | result[].createStatusBar() 15 | result[].setStatusText("Welcome to wxWidgets!") 16 | 17 | let menuFile = cnew constructWxMenu() 18 | 19 | let helloID = newControlId() 20 | menuFile[].append(helloID, "&Hello...\tCtrl-H", 21 | "Help string shown in status bar for this menu item") 22 | menuFile[].appendSeparator() 23 | menuFile[].append(wxID_EXIT) 24 | let menuHelp = cnew constructWxMenu() 25 | menuHelp[].append(wxID_ABOUT) 26 | let menuBar = cnew constructWxMenuBar() 27 | menuBar.append(menuFile, "&File") 28 | menuBar.append(menuHelp, "&Help") 29 | result[].setMenuBar(menuBar) 30 | 31 | menuBar[].`bind`(wxEVT_MENU, handleButtonClick, wxID_EXIT) 32 | 33 | f.show(true) 34 | 35 | runMainLoop() 36 | -------------------------------------------------------------------------------- /examples/purewx/example2.nim: -------------------------------------------------------------------------------- 1 | import "../../wxnim/wx", "../../wxnim/richtext", "../../wxnim/stc" 2 | 3 | proc createFrame(): ptr WxFrame 4 | let f = createFrame() 5 | 6 | proc handleButtonClick(e: var WxCommandEvent) {.cdecl.} = 7 | f[].setStatusText("Quit called!") 8 | 9 | proc createFrame(): ptr WxFrame = 10 | result = cnew constructWxFrame(nil, wxID_ANY, "Hello World", 11 | constructWxPoint(50, 50), 12 | constructWxSize(450, 340)) 13 | result[].createStatusBar() 14 | result[].setStatusText("Welcome to wxWidgets!") 15 | 16 | let menuFile = cnew constructWxMenu() 17 | 18 | let helloID = newControlId() 19 | menuFile[].append(helloID, "&Hello...\tCtrl-H", 20 | "Help string shown in status bar for this menu item") 21 | menuFile[].appendSeparator() 22 | menuFile[].append(wxID_EXIT) 23 | let menuHelp = cnew constructWxMenu() 24 | menuHelp[].append(wxID_ABOUT) 25 | let menuBar = cnew constructWxMenuBar() 26 | menuBar.append(menuFile, "&File") 27 | menuBar.append(menuHelp, "&Help") 28 | result[].setMenuBar(menuBar) 29 | 30 | menuBar[].`bind`(wxEVT_MENU, handleButtonClick, wxID_EXIT) 31 | 32 | let text = cnew constructWxStyledTextCtrl(result, wxID_ANY) 33 | text.styleClearAll() 34 | text.setLexer(wxSTC_LEX_CPP) 35 | 36 | text.setMarginWidth(0, 50) 37 | text.styleSetForeground(wxSTC_STYLE_LINENUMBER, constructWxColour(75, 75, 75) ) 38 | text.styleSetBackground(wxSTC_STYLE_LINENUMBER, constructWxColour(220, 220, 220)) 39 | text.setMarginType(0, wxSTC_MARGIN_NUMBER) 40 | 41 | text.setKeyWords(0, "return for while break continue") 42 | text.setKeyWords(1, "const int float void char double") 43 | 44 | let sizer = cnew constructWxBoxSizer(wxVERTICAL) 45 | sizer[].add(text, 1, wxEXPAND.cint) 46 | result.setSizer(sizer) 47 | 48 | 49 | f.show(true) 50 | 51 | runMainLoop() 52 | -------------------------------------------------------------------------------- /examples/purewx/nim.cfg: -------------------------------------------------------------------------------- 1 | @if windows: 2 | --app:gui 3 | @end 4 | -------------------------------------------------------------------------------- /headers/bmpbuttn.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/bmpbuttn.h 3 | // Purpose: wxBitmapButton class interface 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 25.08.00 7 | // Copyright: (c) 2000 Vadim Zeitlin 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_BMPBUTTON_H_BASE_ 12 | #define _WX_BMPBUTTON_H_BASE_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_BMPBUTTON 17 | 18 | #include "wx/button.h" 19 | 20 | // FIXME: right now only wxMSW, wxGTK and wxOSX implement bitmap support in wxButton 21 | // itself, this shouldn't be used for the other platforms neither 22 | // when all of them do it 23 | #if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__)) && !defined(__WXUNIVERSAL__) 24 | #define wxHAS_BUTTON_BITMAP 25 | #endif 26 | 27 | class WXDLLIMPEXP_FWD_CORE wxBitmapButton {}; 28 | 29 | // ---------------------------------------------------------------------------- 30 | // wxBitmapButton: a button which shows bitmaps instead of the usual string. 31 | // It has different bitmaps for different states (focused/disabled/pressed) 32 | // ---------------------------------------------------------------------------- 33 | 34 | class WXDLLIMPEXP_CORE wxBitmapButtonBase : public wxButton 35 | { 36 | public: 37 | wxBitmapButtonBase() 38 | { 39 | } 40 | 41 | bool Create(wxWindow *parent, 42 | wxWindowID winid, 43 | const wxPoint& pos, 44 | const wxSize& size, 45 | long style, 46 | const wxValidator& validator, 47 | const wxString& name) 48 | { 49 | // We use wxBU_NOTEXT to let the base class Create() know that we are 50 | // not going to show the label: this is a hack needed for wxGTK where 51 | // we can show both label and bitmap only with GTK 2.6+ but we always 52 | // can show just one of them and this style allows us to choose which 53 | // one we need. 54 | // 55 | // And we also use wxBU_EXACTFIT to avoid being resized up to the 56 | // standard button size as this doesn't make sense for bitmap buttons 57 | // which are not standard anyhow and should fit their bitmap size. 58 | return wxButton::Create(parent, winid, "", 59 | pos, size, 60 | style | wxBU_NOTEXT | wxBU_EXACTFIT, 61 | validator, name); 62 | } 63 | 64 | // Special creation function for a standard "Close" bitmap. It allows to 65 | // simply create a close button with the image appropriate for the common 66 | // platform. 67 | static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid); 68 | 69 | 70 | // set/get the margins around the button 71 | virtual void SetMargins(int x, int y) 72 | { 73 | DoSetBitmapMargins(x, y); 74 | } 75 | 76 | int GetMarginX() const { return DoGetBitmapMargins().x; } 77 | int GetMarginY() const { return DoGetBitmapMargins().y; } 78 | 79 | wxDECLARE_NO_COPY_CLASS(wxBitmapButtonBase); 80 | }; 81 | 82 | #endif // wxUSE_BMPBUTTON 83 | 84 | #endif // _WX_BMPBUTTON_H_BASE_ 85 | -------------------------------------------------------------------------------- /headers/button.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/button.h 3 | // Purpose: wxButtonBase class 4 | // Author: Vadim Zetlin 5 | // Modified by: 6 | // Created: 15.08.00 7 | // Copyright: (c) Vadim Zetlin 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_BUTTON_H_BASE_ 12 | #define _WX_BUTTON_H_BASE_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_BUTTON 17 | 18 | #include "wx/anybutton.h" 19 | 20 | // ---------------------------------------------------------------------------- 21 | // wxButton: a push button 22 | // ---------------------------------------------------------------------------- 23 | 24 | class WXDLLIMPEXP_CORE wxButtonBase : public wxAnyButton 25 | { 26 | public: 27 | wxButtonBase() { } 28 | 29 | // show the authentication needed symbol on the button: this is currently 30 | // only implemented on Windows Vista and newer (on which it shows the UAC 31 | // shield symbol) 32 | void SetAuthNeeded(bool show = true) { DoSetAuthNeeded(show); } 33 | bool GetAuthNeeded() const { return DoGetAuthNeeded(); } 34 | 35 | // make this button the default button in its top level window 36 | // 37 | // returns the old default item (possibly NULL) 38 | virtual wxWindow *SetDefault(); 39 | 40 | // returns the default button size for this platform 41 | static wxSize GetDefaultSize(); 42 | 43 | wxDECLARE_NO_COPY_CLASS(wxButtonBase); 44 | }; 45 | 46 | 47 | class WXDLLIMPEXP_CORE wxButton : public wxButtonBase 48 | { 49 | public: 50 | wxButton() { Init(); } 51 | wxButton(wxWindow *parent, 52 | wxWindowID id, 53 | const wxString& label = wxEmptyString, 54 | const wxPoint& pos = wxDefaultPosition, 55 | const wxSize& size = wxDefaultSize, 56 | long style = 0, 57 | const wxValidator& validator = wxDefaultValidator, 58 | const wxString& name = wxButtonNameStr) 59 | { 60 | Init(); 61 | 62 | Create(parent, id, label, pos, size, style, validator, name); 63 | } 64 | 65 | bool Create(wxWindow *parent, 66 | wxWindowID id, 67 | const wxString& label = wxEmptyString, 68 | const wxPoint& pos = wxDefaultPosition, 69 | const wxSize& size = wxDefaultSize, 70 | long style = 0, 71 | const wxValidator& validator = wxDefaultValidator, 72 | const wxString& name = wxButtonNameStr); 73 | 74 | virtual ~wxButton(); 75 | 76 | virtual wxWindow *SetDefault(); 77 | 78 | // implementation from now on 79 | virtual void Command(wxCommandEvent& event); 80 | 81 | protected: 82 | // send a notification event, return true if processed 83 | bool SendClickEvent(); 84 | 85 | // default button handling 86 | void SetTmpDefault(); 87 | void UnsetTmpDefault(); 88 | 89 | // set or unset BS_DEFPUSHBUTTON style 90 | static void SetDefaultStyle(wxButton *btn, bool on); 91 | 92 | virtual bool DoGetAuthNeeded() const; 93 | virtual void DoSetAuthNeeded(bool show); 94 | 95 | // true if the UAC symbol is shown 96 | bool m_authNeeded; 97 | 98 | private: 99 | void Init() 100 | { 101 | m_authNeeded = false; 102 | } 103 | 104 | void OnCharHook(wxKeyEvent& event); 105 | }; 106 | 107 | #endif // wxUSE_BUTTON 108 | 109 | #endif // _WX_BUTTON_H_BASE_ 110 | -------------------------------------------------------------------------------- /headers/checklst.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/checklst.h 3 | // Purpose: wxCheckListBox class interface 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 12.09.00 7 | // Copyright: (c) Vadim Zeitlin 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_CHECKLST_H_BASE_ 12 | #define _WX_CHECKLST_H_BASE_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_CHECKLISTBOX 17 | 18 | #include "wx/listbox.h" 19 | 20 | // ---------------------------------------------------------------------------- 21 | // wxCheckListBox: a listbox whose items may be checked 22 | // ---------------------------------------------------------------------------- 23 | 24 | class WXDLLIMPEXP_CORE wxCheckListBoxBase : public 25 | wxListBox 26 | { 27 | public: 28 | wxCheckListBoxBase() { } 29 | 30 | // check list box specific methods 31 | virtual bool IsChecked(unsigned int item) const = 0; 32 | virtual void Check(unsigned int item, bool check = true) = 0; 33 | 34 | virtual unsigned int GetCheckedItems(wxArrayInt& checkedItems) const; 35 | 36 | wxDECLARE_NO_COPY_CLASS(wxCheckListBoxBase); 37 | }; 38 | 39 | #endif // wxUSE_CHECKLISTBOX 40 | 41 | #endif 42 | // _WX_CHECKLST_H_BASE_ 43 | -------------------------------------------------------------------------------- /headers/colordlg.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/colordlg.h 3 | // Purpose: wxColourDialog 4 | // Author: Vadim Zeitiln 5 | // Modified by: 6 | // Created: 01/02/97 7 | // Copyright: (c) wxWidgets team 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_COLORDLG_H_BASE_ 12 | #define _WX_COLORDLG_H_BASE_ 13 | 14 | class wxColourData {}; 15 | 16 | // get the colour from user and return it 17 | WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = NULL, 18 | const wxColour& colInit = wxNullColour, 19 | const wxString& caption = wxEmptyString, 20 | wxColourData *data = NULL); 21 | 22 | #endif 23 | // _WX_COLORDLG_H_BASE_ 24 | -------------------------------------------------------------------------------- /headers/datectrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/datectrl.h 3 | // Purpose: implements wxDatePickerCtrl 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 2005-01-09 7 | // Copyright: (c) 2005 Vadim Zeitlin 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_DATECTRL_H_ 12 | #define _WX_DATECTRL_H_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_DATEPICKCTRL 17 | 18 | #include "wx/datetimectrl.h" // the base class 19 | 20 | // wxDatePickerCtrl styles 21 | enum 22 | { 23 | // default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN 24 | wxDP_DEFAULT = 0, 25 | 26 | // a spin control-like date picker (not supported in generic version) 27 | wxDP_SPIN = 1, 28 | 29 | // a combobox-like date picker (not supported in mac version) 30 | wxDP_DROPDOWN = 2, 31 | 32 | // always show century in the default date display (otherwise it depends on 33 | // the system date format which may include the century or not) 34 | wxDP_SHOWCENTURY = 4, 35 | 36 | // allow not having any valid date in the control (by default it always has 37 | // some date, today initially if no valid date specified in ctor) 38 | wxDP_ALLOWNONE = 8 39 | }; 40 | 41 | // ---------------------------------------------------------------------------- 42 | // wxDatePickerCtrl: allow the user to enter the date 43 | // ---------------------------------------------------------------------------- 44 | 45 | class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxDateTimePickerCtrl 46 | { 47 | public: 48 | /* 49 | The derived classes should implement ctor and Create() method with the 50 | following signature: 51 | 52 | bool Create(wxWindow *parent, 53 | wxWindowID id, 54 | const wxDateTime& dt = wxDefaultDateTime, 55 | const wxPoint& pos = wxDefaultPosition, 56 | const wxSize& size = wxDefaultSize, 57 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, 58 | const wxValidator& validator = wxDefaultValidator, 59 | const wxString& name = wxDatePickerCtrlNameStr); 60 | */ 61 | 62 | /* 63 | We inherit the methods to set/get the date from the base class. 64 | 65 | virtual void SetValue(const wxDateTime& dt) = 0; 66 | virtual wxDateTime GetValue() const = 0; 67 | */ 68 | 69 | // And add methods to set/get the allowed valid range for the dates. If 70 | // either/both of them are invalid, there is no corresponding limit and if 71 | // neither is set, GetRange() returns false. 72 | virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0; 73 | virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0; 74 | }; 75 | 76 | 77 | class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase 78 | { 79 | public: 80 | wxDatePickerCtrl() { } 81 | wxDatePickerCtrl(wxWindow *parent, 82 | wxWindowID id, 83 | const wxDateTime& date = wxDefaultDateTime, 84 | const wxPoint& pos = wxDefaultPosition, 85 | const wxSize& size = wxDefaultSize, 86 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, 87 | const wxValidator& validator = wxDefaultValidator, 88 | const wxString& name = wxDatePickerCtrlNameStr) 89 | { 90 | } 91 | 92 | private: 93 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl) 94 | }; 95 | #endif // wxUSE_DATEPICKCTRL 96 | 97 | #endif // _WX_DATECTRL_H_ 98 | 99 | -------------------------------------------------------------------------------- /headers/datetimectrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/timectrl.h 3 | // Purpose: Declaration of wxDateTimePickerCtrl class. 4 | // Author: Vadim Zeitlin 5 | // Created: 2011-09-22 6 | // Copyright: (c) 2011 Vadim Zeitlin 7 | // Licence: wxWindows licence 8 | /////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef _WX_DATETIME_CTRL_H_ 11 | #define _WX_DATETIME_CTRL_H_ 12 | 13 | #include "wx/defs.h" 14 | 15 | #if wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL 16 | 17 | #define wxNEEDS_DATETIMEPICKCTRL 18 | 19 | #include "wx/control.h" // the base class 20 | 21 | #include "wx/datetime.h" 22 | 23 | // ---------------------------------------------------------------------------- 24 | // wxDateTimePickerCtrl: Private common base class of wx{Date,Time}PickerCtrl. 25 | // ---------------------------------------------------------------------------- 26 | 27 | // This class is an implementation detail and should not be used directly, only 28 | // use the documented API of wxDateTimePickerCtrl and wxTimePickerCtrl. 29 | class WXDLLIMPEXP_ADV wxDateTimePickerCtrlBase : public wxControl 30 | { 31 | public: 32 | // Set/get the date or time (in the latter case, time part is ignored). 33 | virtual void SetValue(const wxDateTime& dt) = 0; 34 | virtual wxDateTime GetValue() const = 0; 35 | }; 36 | 37 | 38 | typedef wxDateTimePickerCtrlBase wxDateTimePickerCtrl; 39 | 40 | #endif // wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL 41 | 42 | #endif // _WX_DATETIME_CTRL_H_ 43 | -------------------------------------------------------------------------------- /headers/dialog.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/univ/dialog.h 3 | // Purpose: wxDialog class 4 | // Author: Vaclav Slavik 5 | // Created: 2001/09/16 6 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) 7 | // Licence: wxWindows licence 8 | ///////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef _WX_UNIV_DIALOG_H_ 11 | #define _WX_UNIV_DIALOG_H_ 12 | 13 | extern long wxDEFAULT_DIALOG_STYLE; 14 | 15 | // Dialog boxes 16 | class WXDLLIMPEXP_CORE wxDialog : public wxWindow 17 | { 18 | public: 19 | wxDialog() { Init(); } 20 | 21 | // Constructor with no modal flag - the new convention. 22 | wxDialog(wxWindow *parent, wxWindowID id, 23 | const wxString& title, 24 | const wxPoint& pos = wxDefaultPosition, 25 | const wxSize& size = wxDefaultSize, 26 | long style = wxDEFAULT_DIALOG_STYLE, 27 | const wxString& name = wxDialogNameStr) 28 | { 29 | Init(); 30 | Create(parent, id, title, pos, size, style, name); 31 | } 32 | 33 | bool Create(wxWindow *parent, wxWindowID id, 34 | const wxString& title, 35 | const wxPoint& pos = wxDefaultPosition, 36 | const wxSize& size = wxDefaultSize, 37 | long style = wxDEFAULT_DIALOG_STYLE, 38 | const wxString& name = wxDialogNameStr); 39 | 40 | virtual ~wxDialog(); 41 | 42 | // is the dialog in modal state right now? 43 | virtual bool IsModal() const; 44 | 45 | // For now, same as Show(true) but returns return code 46 | virtual int ShowModal(); 47 | 48 | // may be called to terminate the dialog with the given return code 49 | virtual void EndModal(int retCode); 50 | 51 | // returns true if we're in a modal loop 52 | bool IsModalShowing() const; 53 | 54 | virtual bool Show(bool show = true); 55 | 56 | // implementation only from now on 57 | // ------------------------------- 58 | 59 | // event handlers 60 | void OnCloseWindow(wxCloseEvent& event); 61 | void OnOK(wxCommandEvent& event); 62 | void OnApply(wxCommandEvent& event); 63 | void OnCancel(wxCommandEvent& event); 64 | 65 | protected: 66 | // common part of all ctors 67 | void Init(); 68 | 69 | }; 70 | 71 | #endif 72 | // _WX_UNIV_DIALOG_H_ 73 | -------------------------------------------------------------------------------- /headers/dirdlg.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/dirdlg.h 3 | // Purpose: wxDirDialog base class 4 | // Author: Robert Roebling 5 | // Modified by: 6 | // Created: 7 | // Copyright: (c) Robert Roebling 8 | // Licence: wxWindows Licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_DIRDLG_H_BASE_ 12 | #define _WX_DIRDLG_H_BASE_ 13 | 14 | #if wxUSE_DIRDLG 15 | 16 | #include "wx/dialog.h" 17 | 18 | // ---------------------------------------------------------------------------- 19 | // constants 20 | // ---------------------------------------------------------------------------- 21 | 22 | #define wxDD_CHANGE_DIR 0x0100 23 | #define wxDD_DIR_MUST_EXIST 0x0200 24 | 25 | // deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it 26 | #define wxDD_NEW_DIR_BUTTON 0 27 | 28 | extern long wxDD_DEFAULT_STYLE; 29 | 30 | //------------------------------------------------------------------------- 31 | // wxDirDialogBase 32 | //------------------------------------------------------------------------- 33 | 34 | class WXDLLIMPEXP_CORE wxDirDialogBase : public wxDialog 35 | { 36 | public: 37 | wxDirDialogBase() {} 38 | wxDirDialogBase(wxWindow *parent, 39 | const wxString& title = wxDirSelectorPromptStr, 40 | const wxString& defaultPath = wxEmptyString, 41 | long style = wxDD_DEFAULT_STYLE, 42 | const wxPoint& pos = wxDefaultPosition, 43 | const wxSize& sz = wxDefaultSize, 44 | const wxString& name = wxDirDialogNameStr) 45 | { 46 | Create(parent, title, defaultPath, style, pos, sz, name); 47 | } 48 | 49 | virtual ~wxDirDialogBase() {} 50 | 51 | 52 | bool Create(wxWindow *parent, 53 | const wxString& title = wxDirSelectorPromptStr, 54 | const wxString& defaultPath = wxEmptyString, 55 | long style = wxDD_DEFAULT_STYLE, 56 | const wxPoint& pos = wxDefaultPosition, 57 | const wxSize& sz = wxDefaultSize, 58 | const wxString& name = wxDirDialogNameStr) 59 | { 60 | if (!wxDialog::Create(parent, wxID_ANY, title, pos, sz, style, name)) 61 | return false; 62 | m_path = defaultPath; 63 | m_message = title; 64 | return true; 65 | } 66 | 67 | virtual void SetMessage(const wxString& message) { m_message = message; } 68 | virtual void SetPath(const wxString& path) { m_path = path; } 69 | 70 | virtual wxString GetMessage() const { return m_message; } 71 | virtual wxString GetPath() const { return m_path; } 72 | 73 | protected: 74 | wxString m_message; 75 | wxString m_path; 76 | }; 77 | 78 | 79 | // ---------------------------------------------------------------------------- 80 | // common ::wxDirSelector() function 81 | // ---------------------------------------------------------------------------- 82 | 83 | WXDLLIMPEXP_CORE wxString 84 | wxDirSelector(const wxString& message = wxDirSelectorPromptStr, 85 | const wxString& defaultPath = wxEmptyString, 86 | long style = wxDD_DEFAULT_STYLE, 87 | const wxPoint& pos = wxDefaultPosition, 88 | wxWindow *parent = NULL); 89 | 90 | #endif // wxUSE_DIRDLG 91 | 92 | #endif 93 | // _WX_DIRDLG_H_BASE_ 94 | -------------------------------------------------------------------------------- /headers/fontdata.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/fontdata.h 3 | // Author: Julian Smart 4 | // Copyright: (c) Julian Smart 5 | // Licence: wxWindows licence 6 | ///////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef _WX_FONTDATA_H_ 9 | #define _WX_FONTDATA_H_ 10 | 11 | #include "wx/font.h" 12 | #include "wx/colour.h" 13 | #include "wx/encinfo.h" 14 | 15 | class WXDLLIMPEXP_CORE wxFontData : public wxObject 16 | { 17 | public: 18 | wxFontData(); 19 | virtual ~wxFontData(); 20 | 21 | wxFontData(const wxFontData& data); 22 | wxFontData& operator=(const wxFontData& data); 23 | 24 | void SetAllowSymbols(bool flag) { m_allowSymbols = flag; } 25 | bool GetAllowSymbols() const { return m_allowSymbols; } 26 | 27 | void SetColour(const wxColour& colour) { m_fontColour = colour; } 28 | const wxColour& GetColour() const { return m_fontColour; } 29 | 30 | void SetShowHelp(bool flag) { m_showHelp = flag; } 31 | bool GetShowHelp() const { return m_showHelp; } 32 | 33 | void EnableEffects(bool flag) { m_enableEffects = flag; } 34 | bool GetEnableEffects() const { return m_enableEffects; } 35 | 36 | void SetInitialFont(const wxFont& font) { m_initialFont = font; } 37 | wxFont GetInitialFont() const { return m_initialFont; } 38 | 39 | void SetChosenFont(const wxFont& font) { m_chosenFont = font; } 40 | wxFont GetChosenFont() const { return m_chosenFont; } 41 | 42 | void SetRange(int minRange, int maxRange) { m_minSize = minRange; m_maxSize = maxRange; } 43 | 44 | // encoding info is split into 2 parts: the logical wxWin encoding 45 | // (wxFontEncoding) and a structure containing the native parameters for 46 | // it (wxNativeEncodingInfo) 47 | wxFontEncoding GetEncoding() const { return m_encoding; } 48 | void SetEncoding(wxFontEncoding encoding) { m_encoding = encoding; } 49 | 50 | // public for backwards compatibility only: don't use directly 51 | wxColour m_fontColour; 52 | bool m_showHelp; 53 | bool m_allowSymbols; 54 | bool m_enableEffects; 55 | wxFont m_initialFont; 56 | wxFont m_chosenFont; 57 | int m_minSize; 58 | int m_maxSize; 59 | 60 | private: 61 | wxFontEncoding m_encoding; 62 | 63 | DECLARE_DYNAMIC_CLASS(wxFontData) 64 | }; 65 | 66 | #endif // _WX_FONTDATA_H_ 67 | -------------------------------------------------------------------------------- /headers/fontdlg.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/fontdlg.h 3 | // Purpose: common interface for different wxFontDialog classes 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 12.05.02 7 | // Copyright: (c) 1997-2002 wxWidgets team 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_FONTDLG_H_BASE_ 12 | #define _WX_FONTDLG_H_BASE_ 13 | 14 | #include "wx/defs.h" // for wxUSE_FONTDLG 15 | 16 | #if wxUSE_FONTDLG 17 | 18 | #include "wx/dialog.h" // the base class 19 | #include "wx/fontdata.h" 20 | 21 | // ---------------------------------------------------------------------------- 22 | // wxFontDialog interface 23 | // ---------------------------------------------------------------------------- 24 | 25 | class WXDLLIMPEXP_CORE wxFontDialogBase : public wxDialog 26 | { 27 | public: 28 | // create the font dialog 29 | wxFontDialogBase() { } 30 | wxFontDialogBase(wxWindow *parent) { m_parent = parent; } 31 | wxFontDialogBase(wxWindow *parent, const wxFontData& data) 32 | { m_parent = parent; InitFontData(&data); } 33 | 34 | bool Create(wxWindow *parent) 35 | { return DoCreate(parent); } 36 | bool Create(wxWindow *parent, const wxFontData& data) 37 | { InitFontData(&data); return Create(parent); } 38 | 39 | // retrieve the font data 40 | const wxFontData& GetFontData() const { return m_fontData; } 41 | wxFontData& GetFontData() { return m_fontData; } 42 | 43 | 44 | protected: 45 | virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; } 46 | 47 | void InitFontData(const wxFontData *data = NULL) 48 | { if ( data ) m_fontData = *data; } 49 | 50 | wxFontData m_fontData; 51 | 52 | wxDECLARE_NO_COPY_CLASS(wxFontDialogBase); 53 | }; 54 | 55 | 56 | // get the font from user and return it, returns wxNullFont if the dialog was 57 | // cancelled 58 | WXDLLIMPEXP_CORE wxFont wxGetFontFromUser(wxWindow *parent = NULL, 59 | const wxFont& fontInit = wxNullFont, 60 | const wxString& caption = wxEmptyString); 61 | 62 | #endif // wxUSE_FONTDLG 63 | 64 | #endif 65 | // _WX_FONTDLG_H_BASE_ 66 | -------------------------------------------------------------------------------- /headers/fontenum.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/fontenum.h 3 | // Purpose: wxFontEnumerator class for getting available fonts 4 | // Author: Julian Smart, Vadim Zeitlin 5 | // Modified by: extended to enumerate more than just font facenames and works 6 | // not only on Windows now (VZ) 7 | // Created: 04/01/98 8 | // Copyright: (c) Julian Smart, Vadim Zeitlin 9 | // Licence: wxWindows licence 10 | ///////////////////////////////////////////////////////////////////////////// 11 | 12 | #ifndef _WX_FONTENUM_H_ 13 | #define _WX_FONTENUM_H_ 14 | 15 | #include "wx/defs.h" 16 | 17 | #if wxUSE_FONTENUM 18 | 19 | #include "wx/fontenc.h" 20 | #include "wx/arrstr.h" 21 | 22 | // ---------------------------------------------------------------------------- 23 | // wxFontEnumerator enumerates all available fonts on the system or only the 24 | // fonts with given attributes 25 | // ---------------------------------------------------------------------------- 26 | 27 | class WXDLLIMPEXP_CORE wxFontEnumerator 28 | { 29 | public: 30 | wxFontEnumerator() {} 31 | 32 | // virtual dtor for the base class 33 | virtual ~wxFontEnumerator() {} 34 | 35 | // start enumerating font facenames (either all of them or those which 36 | // support the given encoding) - will result in OnFacename() being 37 | // called for each available facename (until they are exhausted or 38 | // OnFacename returns false) 39 | virtual bool EnumerateFacenames 40 | ( 41 | wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all 42 | bool fixedWidthOnly = false 43 | ); 44 | 45 | // enumerate the different encodings either for given font facename or for 46 | // all facenames - will result in OnFontEncoding() being called for each 47 | // available (facename, encoding) couple 48 | virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString); 49 | 50 | // callbacks which are called after one of EnumerateXXX() functions from 51 | // above is invoked - all of them may return false to stop enumeration or 52 | // true to continue with it 53 | 54 | // called by EnumerateFacenames 55 | virtual bool OnFacename(const wxString& WXUNUSED(facename)) 56 | { return true; } 57 | 58 | // called by EnumerateEncodings 59 | virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), 60 | const wxString& WXUNUSED(encoding)) 61 | { return true; } 62 | 63 | 64 | 65 | // convenience function that returns array of facenames. 66 | static wxArrayString 67 | GetFacenames(wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all 68 | bool fixedWidthOnly = false); 69 | 70 | // convenience function that returns array of all available encodings. 71 | static wxArrayString GetEncodings(const wxString& facename = wxEmptyString); 72 | 73 | // convenience function that returns true if the given face name exist 74 | // in the user's system 75 | static bool IsValidFacename(const wxString &str); 76 | 77 | private: 78 | 79 | wxDECLARE_NO_COPY_CLASS(wxFontEnumerator); 80 | }; 81 | 82 | #endif // wxUSE_FONTENUM 83 | 84 | #endif // _WX_FONTENUM_H_ 85 | -------------------------------------------------------------------------------- /headers/icon.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/generic/icon.h 3 | // Purpose: wxIcon implementation for ports where it's same as wxBitmap 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 17/09/98 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_GENERIC_ICON_H_ 12 | #define _WX_GENERIC_ICON_H_ 13 | 14 | #include "wx/bitmap.h" 15 | 16 | //----------------------------------------------------------------------------- 17 | // wxIcon 18 | //----------------------------------------------------------------------------- 19 | extern wxBitmapType wxICON_DEFAULT_TYPE; 20 | 21 | class WXDLLIMPEXP_CORE wxIcon: public wxBitmap 22 | { 23 | public: 24 | wxIcon(); 25 | 26 | wxIcon(const char* const* bits); 27 | 28 | // For compatibility with wxMSW where desired size is sometimes required to 29 | // distinguish between multiple icons in a resource. 30 | wxIcon( const wxString& filename, 31 | wxBitmapType type = wxICON_DEFAULT_TYPE, 32 | int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : 33 | wxBitmap(filename, type) 34 | { 35 | } 36 | 37 | bool LoadFile(const wxString& name, wxBitmapType flags, 38 | int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight)) 39 | { return wxBitmap::LoadFile(name, flags); } 40 | 41 | // unhide the base class version 42 | virtual bool LoadFile(const wxString& name, 43 | wxBitmapType flags = wxICON_DEFAULT_TYPE) 44 | { return wxBitmap::LoadFile(name, flags); } 45 | 46 | // create from bitmap (which should have a mask unless it's monochrome): 47 | // there shouldn't be any implicit bitmap -> icon conversion (i.e. no 48 | // ctors, assignment operators...), but it's ok to have such function 49 | void CopyFromBitmap(const wxBitmap& bmp); 50 | 51 | private: 52 | DECLARE_DYNAMIC_CLASS(wxIcon) 53 | }; 54 | 55 | #endif // _WX_GENERIC_ICON_H_ 56 | -------------------------------------------------------------------------------- /headers/kbdstate.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/kbdstate.h 3 | // Purpose: Declaration of wxKeyboardState class 4 | // Author: Vadim Zeitlin 5 | // Created: 2008-09-19 6 | // Copyright: (c) 2008 Vadim Zeitlin 7 | // Licence: wxWindows licence 8 | /////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef _WX_KBDSTATE_H_ 11 | #define _WX_KBDSTATE_H_ 12 | 13 | #include "wx/defs.h" 14 | 15 | // ---------------------------------------------------------------------------- 16 | // wxKeyboardState stores the state of the keyboard modifier keys 17 | // ---------------------------------------------------------------------------- 18 | 19 | class WXDLLIMPEXP_CORE wxKeyboardState 20 | { 21 | public: 22 | wxKeyboardState(bool controlDown = false, 23 | bool shiftDown = false, 24 | bool altDown = false, 25 | bool metaDown = false) 26 | : m_controlDown(controlDown), 27 | m_shiftDown(shiftDown), 28 | m_altDown(altDown), 29 | m_metaDown(metaDown) 30 | { 31 | } 32 | 33 | // default copy ctor, assignment operator and dtor are ok 34 | 35 | 36 | // accessors for the various modifier keys 37 | // --------------------------------------- 38 | 39 | // should be used check if the key event has exactly the given modifiers: 40 | // "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown() 41 | // && !MetaDown() && !AltDown() && !ShiftDown()" 42 | int GetModifiers() const 43 | { 44 | return (m_controlDown ? wxMOD_CONTROL : 0) | 45 | (m_shiftDown ? wxMOD_SHIFT : 0) | 46 | (m_metaDown ? wxMOD_META : 0) | 47 | (m_altDown ? wxMOD_ALT : 0); 48 | } 49 | 50 | // returns true if any modifiers at all are pressed 51 | bool HasAnyModifiers() const { return GetModifiers() != wxMOD_NONE; } 52 | 53 | // returns true if any modifiers changing the usual key interpretation are 54 | // pressed, notably excluding Shift 55 | bool HasModifiers() const 56 | { 57 | return ControlDown() || RawControlDown() || AltDown(); 58 | } 59 | 60 | // accessors for individual modifier keys 61 | bool ControlDown() const { return m_controlDown; } 62 | bool RawControlDown() const 63 | { 64 | return m_rawControlDown; 65 | } 66 | bool ShiftDown() const { return m_shiftDown; } 67 | bool MetaDown() const { return m_metaDown; } 68 | bool AltDown() const { return m_altDown; } 69 | 70 | // "Cmd" is a pseudo key which is Control for PC and Unix platforms but 71 | // Apple ("Command") key under Macs: it makes often sense to use it instead 72 | // of, say, ControlDown() because Cmd key is used for the same thing under 73 | // Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this 74 | // purpose under Mac) 75 | bool CmdDown() const 76 | { 77 | return ControlDown(); 78 | } 79 | 80 | // these functions are mostly used by wxWidgets itself 81 | // --------------------------------------------------- 82 | 83 | void SetControlDown(bool down) { m_controlDown = down; } 84 | void SetRawControlDown(bool down) 85 | { 86 | m_controlDown = down; 87 | } 88 | void SetShiftDown(bool down) { m_shiftDown = down; } 89 | void SetAltDown(bool down) { m_altDown = down; } 90 | void SetMetaDown(bool down) { m_metaDown = down; } 91 | 92 | 93 | // for backwards compatibility with the existing code accessing these 94 | // members of wxKeyEvent directly, these variables are public, however you 95 | // should not use them in any new code, please use the accessors instead 96 | public: 97 | bool m_controlDown ; 98 | bool m_shiftDown ; 99 | bool m_altDown ; 100 | bool m_metaDown ; 101 | 102 | }; 103 | 104 | #endif // _WX_KBDSTATE_H_ 105 | 106 | -------------------------------------------------------------------------------- /headers/listbook.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/listbook.h 3 | // Purpose: wxListbook: wxListCtrl and wxNotebook combination 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 19.08.03 7 | // Copyright: (c) 2003 Vadim Zeitlin 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_LISTBOOK_H_ 12 | #define _WX_LISTBOOK_H_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_LISTBOOK 17 | 18 | #include "wx/bookctrl.h" 19 | #include "wx/containr.h" 20 | 21 | class WXDLLIMPEXP_FWD_CORE wxListView; 22 | class WXDLLIMPEXP_FWD_CORE wxListEvent; 23 | 24 | class wxBookCtrlEvent {}; 25 | 26 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LISTBOOK_PAGE_CHANGED, wxBookCtrlEvent ); 27 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LISTBOOK_PAGE_CHANGING, wxBookCtrlEvent ); 28 | 29 | /* 30 | // wxListbook flags 31 | #define wxLB_DEFAULT wxBK_DEFAULT 32 | #define wxLB_TOP wxBK_TOP 33 | #define wxLB_BOTTOM wxBK_BOTTOM 34 | #define wxLB_LEFT wxBK_LEFT 35 | #define wxLB_RIGHT wxBK_RIGHT 36 | #define wxLB_ALIGN_MASK wxBK_ALIGN_MASK 37 | */ 38 | 39 | // ---------------------------------------------------------------------------- 40 | // wxListbook 41 | // ---------------------------------------------------------------------------- 42 | 43 | class WXDLLIMPEXP_CORE wxListbook : public wxControl 44 | { 45 | public: 46 | wxListbook() { } 47 | 48 | wxListbook(wxWindow *parent, 49 | wxWindowID id, 50 | const wxPoint& pos = wxDefaultPosition, 51 | const wxSize& size = wxDefaultSize, 52 | long style = 0, 53 | const wxString& name = wxEmptyString) 54 | { 55 | (void)Create(parent, id, pos, size, style, name); 56 | } 57 | 58 | // quasi ctor 59 | bool Create(wxWindow *parent, 60 | wxWindowID id, 61 | const wxPoint& pos = wxDefaultPosition, 62 | const wxSize& size = wxDefaultSize, 63 | long style = 0, 64 | const wxString& name = wxEmptyString); 65 | 66 | 67 | // overridden base class methods 68 | virtual bool SetPageText(size_t n, const wxString& strText); 69 | virtual wxString GetPageText(size_t n) const; 70 | virtual int GetPageImage(size_t n) const; 71 | virtual bool SetPageImage(size_t n, int imageId); 72 | virtual bool InsertPage(size_t n, 73 | wxWindow *page, 74 | const wxString& text, 75 | bool bSelect = false, 76 | int imageId = -1); 77 | virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } 78 | virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } 79 | virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; 80 | virtual void SetImageList(wxImageList *imageList); 81 | 82 | virtual bool DeleteAllPages(); 83 | 84 | wxListView* GetListView() const { return (wxListView*)m_bookctrl; } 85 | 86 | protected: 87 | virtual wxWindow *DoRemovePage(size_t page); 88 | 89 | void UpdateSelectedPage(size_t newsel); 90 | 91 | wxBookCtrlEvent* CreatePageChangingEvent() const; 92 | void MakeChangedEvent(wxBookCtrlEvent &event); 93 | 94 | // Get the correct wxListCtrl flags to use depending on our own flags. 95 | long GetListCtrlFlags() const; 96 | 97 | // event handlers 98 | void OnListSelected(wxListEvent& event); 99 | void OnSize(wxSizeEvent& event); 100 | }; 101 | 102 | #endif // wxUSE_LISTBOOK 103 | 104 | #endif // _WX_LISTBOOK_H_ 105 | -------------------------------------------------------------------------------- /headers/ownerdrw.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/ownerdrw.h 3 | // Purpose: interface for owner-drawn GUI elements 4 | // Author: Vadim Zeitlin 5 | // Modified by: Marcin Malich 6 | // Created: 11.11.97 7 | // Copyright: (c) 1998 Vadim Zeitlin 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_OWNERDRW_H_BASE 12 | #define _WX_OWNERDRW_H_BASE 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_OWNER_DRAWN 17 | 18 | #include "wx/font.h" 19 | #include "wx/colour.h" 20 | 21 | class WXDLLIMPEXP_FWD_CORE wxDC {}; 22 | 23 | // ---------------------------------------------------------------------------- 24 | // wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn 25 | // behaviour 26 | // 27 | // wxOwnerDrawn supports drawing of an item with non standard font, color and 28 | // also supports 3 bitmaps: either a checked/unchecked bitmap for a checkable 29 | // element or one unchangeable bitmap otherwise. 30 | // ---------------------------------------------------------------------------- 31 | 32 | class WXDLLIMPEXP_CORE wxOwnerDrawnBase 33 | { 34 | public: 35 | wxOwnerDrawnBase() 36 | { 37 | m_ownerDrawn = false; 38 | m_margin = ms_defaultMargin; 39 | } 40 | 41 | virtual ~wxOwnerDrawnBase() {} 42 | 43 | void SetFont(const wxFont& font) 44 | { m_font = font; m_ownerDrawn = true; } 45 | 46 | wxFont& GetFont() const 47 | { return (wxFont&) m_font; } 48 | 49 | 50 | void SetTextColour(const wxColour& colText) 51 | { m_colText = colText; m_ownerDrawn = true; } 52 | 53 | wxColour& GetTextColour() const 54 | { return (wxColour&) m_colText; } 55 | 56 | void SetBackgroundColour(const wxColour& colBack) 57 | { m_colBack = colBack; m_ownerDrawn = true; } 58 | 59 | wxColour& GetBackgroundColour() const 60 | { return (wxColour&) m_colBack ; } 61 | 62 | 63 | void SetMarginWidth(int width) 64 | { m_margin = width; } 65 | 66 | int GetMarginWidth() const 67 | { return m_margin; } 68 | 69 | static int GetDefaultMarginWidth() 70 | { return ms_defaultMargin; } 71 | 72 | 73 | // get item name (with mnemonics if exist) 74 | virtual wxString GetName() const = 0; 75 | 76 | 77 | // this function might seem strange, but if it returns false it means that 78 | // no non-standard attribute are set, so there is no need for this control 79 | // to be owner-drawn. Moreover, you can force owner-drawn to false if you 80 | // want to change, say, the color for the item but only if it is owner-drawn 81 | // (see wxMenuItem::wxMenuItem for example) 82 | bool IsOwnerDrawn() const 83 | { return m_ownerDrawn; } 84 | 85 | // switch on/off owner-drawing the item 86 | void SetOwnerDrawn(bool ownerDrawn = true) 87 | { m_ownerDrawn = ownerDrawn; } 88 | 89 | 90 | // constants used in OnDrawItem 91 | // (they have the same values as corresponding Win32 constants) 92 | enum wxODAction 93 | { 94 | wxODDrawAll = 0x0001, // redraw entire control 95 | wxODSelectChanged = 0x0002, // selection changed (see Status.Select) 96 | wxODFocusChanged = 0x0004 // keyboard focus changed (see Status.Focus) 97 | }; 98 | 99 | enum wxODStatus 100 | { 101 | wxODSelected = 0x0001, // control is currently selected 102 | wxODGrayed = 0x0002, // item is to be grayed 103 | wxODDisabled = 0x0004, // item is to be drawn as disabled 104 | wxODChecked = 0x0008, // item is to be checked 105 | wxODHasFocus = 0x0010, // item has the keyboard focus 106 | wxODDefault = 0x0020, // item is the default item 107 | wxODHidePrefix= 0x0100 // hide keyboard cues (w2k and xp only) 108 | }; 109 | 110 | // virtual functions to implement drawing (return true if processed) 111 | virtual bool OnMeasureItem(size_t *width, size_t *height); 112 | virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat) = 0; 113 | 114 | protected: 115 | 116 | // get the font and colour to use, whether it is set or not 117 | virtual void GetFontToUse(wxFont& font) const; 118 | virtual void GetColourToUse(wxODStatus stat, wxColour& colText, wxColour& colBack) const; 119 | 120 | private: 121 | bool m_ownerDrawn; // true if something is non standard 122 | 123 | wxFont m_font; // font to use for drawing 124 | wxColour m_colText, // color ----"---"---"---- 125 | m_colBack; // background color 126 | 127 | int m_margin; // space occupied by bitmap to the left of the item 128 | 129 | static int ms_defaultMargin; 130 | }; 131 | 132 | #endif // wxUSE_OWNER_DRAWN 133 | 134 | #endif // _WX_OWNERDRW_H_BASE 135 | -------------------------------------------------------------------------------- /headers/panel.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/panel.h 3 | // Purpose: Base header for wxPanel 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 7 | // Copyright: (c) Julian Smart 8 | // (c) 2011 Vadim Zeitlin 9 | // Licence: wxWindows Licence 10 | ///////////////////////////////////////////////////////////////////////////// 11 | 12 | #ifndef _WX_PANEL_H_BASE_ 13 | #define _WX_PANEL_H_BASE_ 14 | 15 | // ---------------------------------------------------------------------------- 16 | // headers and forward declarations 17 | // ---------------------------------------------------------------------------- 18 | 19 | #include "wx/window.h" 20 | #include "wx/containr.h" 21 | 22 | class WXDLLIMPEXP_FWD_CORE wxControlContainer; 23 | 24 | // ---------------------------------------------------------------------------- 25 | // wxPanel contains other controls and implements TAB traversal between them 26 | // ---------------------------------------------------------------------------- 27 | 28 | class WXDLLIMPEXP_CORE wxPanelBase : public wxWindow 29 | { 30 | public: 31 | wxPanelBase() { } 32 | 33 | // Derived classes should also provide this constructor: 34 | /* 35 | wxPanelBase(wxWindow *parent, 36 | wxWindowID winid = wxID_ANY, 37 | const wxPoint& pos = wxDefaultPosition, 38 | const wxSize& size = wxDefaultSize, 39 | long style = wxTAB_TRAVERSAL | wxNO_BORDER, 40 | const wxString& name = wxPanelNameStr); 41 | */ 42 | 43 | // Pseudo ctor 44 | bool Create(wxWindow *parent, 45 | wxWindowID winid = #@ WxWindowID(wxID_ANY) 46 | @#, 47 | const wxPoint& pos = wxDefaultPosition, 48 | const wxSize& size = wxDefaultSize, 49 | long style = int(wxTAB_TRAVERSAL) | int(wxNO_BORDER), 50 | const wxString& name = wxPanelNameStr); 51 | 52 | 53 | // implementation from now on 54 | // -------------------------- 55 | 56 | virtual void InitDialog(); 57 | 58 | private: 59 | wxDECLARE_NO_COPY_CLASS(wxPanelBase); 60 | }; 61 | 62 | 63 | class WXDLLIMPEXP_CORE wxPanel : public wxPanelBase 64 | { 65 | public: 66 | wxPanel() { } 67 | 68 | wxPanel(wxWindow *parent, 69 | wxWindowID winid = #@ WxWindowID(wxID_ANY) 70 | @#, 71 | const wxPoint& pos = wxDefaultPosition, 72 | const wxSize& size = wxDefaultSize, 73 | long style = int(wxTAB_TRAVERSAL) | int(wxNO_BORDER), 74 | const wxString& name = wxPanelNameStr) 75 | { 76 | Create(parent, winid, pos, size, style, name); 77 | } 78 | 79 | // This is overridden for MSW to return true for all panels that are child 80 | // of a window with themed background (such as wxNotebook) which should 81 | // show through the child panels. 82 | virtual bool HasTransparentBackground(); 83 | 84 | private: 85 | wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel); 86 | }; 87 | 88 | #endif // _WX_PANELH_BASE_ 89 | -------------------------------------------------------------------------------- /headers/position.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/position.h 3 | // Purpose: Common structure and methods for positional information. 4 | // Author: Vadim Zeitlin, Robin Dunn, Brad Anderson, Bryan Petty 5 | // Created: 2007-03-13 6 | // Copyright: (c) 2007 The wxWidgets Team 7 | // Licence: wxWindows licence 8 | ///////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef _WX_POSITION_H_ 11 | #define _WX_POSITION_H_ 12 | 13 | #include "wx/gdicmn.h" 14 | 15 | class WXDLLIMPEXP_CORE wxPosition 16 | { 17 | public: 18 | wxPosition() : m_row(0), m_column(0) {} 19 | wxPosition(int row, int col) : m_row(row), m_column(col) {} 20 | 21 | // default copy ctor and assignment operator are okay. 22 | 23 | int GetRow() const { return m_row; } 24 | int GetColumn() const { return m_column; } 25 | int GetCol() const { return GetColumn(); } 26 | void SetRow(int row) { m_row = row; } 27 | void SetColumn(int column) { m_column = column; } 28 | void SetCol(int column) { SetColumn(column); } 29 | 30 | bool operator==(const wxPosition& p) const 31 | { return m_row == p.m_row && m_column == p.m_column; } 32 | bool operator!=(const wxPosition& p) const 33 | { return !(*this == p); } 34 | 35 | wxPosition& operator+=(const wxPosition& p) 36 | { m_row += p.m_row; m_column += p.m_column; return *this; } 37 | wxPosition& operator-=(const wxPosition& p) 38 | { m_row -= p.m_row; m_column -= p.m_column; return *this; } 39 | wxPosition& operator+=(const wxSize& s) 40 | { m_row += s.y; m_column += s.x; return *this; } 41 | wxPosition& operator-=(const wxSize& s) 42 | { m_row -= s.y; m_column -= s.x; return *this; } 43 | 44 | wxPosition operator+(const wxPosition& p) const 45 | { return wxPosition(m_row + p.m_row, m_column + p.m_column); } 46 | wxPosition operator-(const wxPosition& p) const 47 | { return wxPosition(m_row - p.m_row, m_column - p.m_column); } 48 | wxPosition operator+(const wxSize& s) const 49 | { return wxPosition(m_row + s.y, m_column + s.x); } 50 | wxPosition operator-(const wxSize& s) const 51 | { return wxPosition(m_row - s.y, m_column - s.x); } 52 | 53 | private: 54 | int m_row; 55 | int m_column; 56 | }; 57 | 58 | #endif // _WX_POSITION_H_ 59 | 60 | -------------------------------------------------------------------------------- /headers/radiobut.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/univ/radiobut.h 3 | // Purpose: wxRadioButton declaration 4 | // Author: Vadim Zeitlin 5 | // Modified by: 6 | // Created: 10.09.00 7 | // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) 8 | // Licence: wxWindows licence 9 | /////////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_UNIV_RADIOBUT_H_ 12 | #define _WX_UNIV_RADIOBUT_H_ 13 | 14 | #include "wx/checkbox.h" 15 | 16 | // ---------------------------------------------------------------------------- 17 | // wxRadioButton 18 | // ---------------------------------------------------------------------------- 19 | 20 | class WXDLLIMPEXP_CORE wxRadioButton : public wxCheckBox 21 | { 22 | public: 23 | // constructors 24 | wxRadioButton() { Init(); } 25 | 26 | wxRadioButton(wxWindow *parent, 27 | wxWindowID id, 28 | const wxString& label, 29 | const wxPoint& pos = wxDefaultPosition, 30 | const wxSize& size = wxDefaultSize, 31 | long style = 0, 32 | const wxValidator& validator = wxDefaultValidator, 33 | const wxString& name = wxRadioButtonNameStr) 34 | { 35 | Init(); 36 | 37 | Create(parent, id, label, pos, size, style, validator, name); 38 | } 39 | 40 | bool Create(wxWindow *parent, 41 | wxWindowID id, 42 | const wxString& label, 43 | const wxPoint& pos = wxDefaultPosition, 44 | const wxSize& size = wxDefaultSize, 45 | long style = 0, 46 | const wxValidator& validator = wxDefaultValidator, 47 | const wxString& name = wxRadioButtonNameStr); 48 | 49 | // override some base class methods 50 | virtual void ChangeValue(bool value); 51 | 52 | protected: 53 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } 54 | 55 | // implement our own drawing 56 | virtual void DoDraw(wxControlRenderer *renderer); 57 | 58 | // we use the radio button bitmaps for size calculation 59 | virtual wxSize GetBitmapSize() const; 60 | 61 | // the radio button can only be cleared using this method, not 62 | // ChangeValue() above - and it is protected as it can only be called by 63 | // another radiobutton 64 | void ClearValue(); 65 | 66 | // called when the radio button becomes checked: we clear all the buttons 67 | // in the same group with us here 68 | virtual void OnCheck(); 69 | 70 | // send event about radio button selection 71 | virtual void SendEvent(); 72 | 73 | private: 74 | DECLARE_DYNAMIC_CLASS(wxRadioButton) 75 | }; 76 | 77 | #endif // _WX_UNIV_RADIOBUT_H_ 78 | -------------------------------------------------------------------------------- /headers/richtext/richtextbackgroundpage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtextbackgroundpage.h 3 | // Purpose: 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 13/11/2010 11:17:25 7 | // RCS-ID: 8 | // Copyright: (c) Julian Smart 9 | // Licence: 10 | ///////////////////////////////////////////////////////////////////////////// 11 | 12 | #ifndef _RICHTEXTBACKGROUNDPAGE_H_ 13 | #define _RICHTEXTBACKGROUNDPAGE_H_ 14 | 15 | /*! 16 | * Includes 17 | */ 18 | 19 | #include "wx/richtext/richtextdialogpage.h" 20 | 21 | ////@begin includes 22 | #include "wx/statline.h" 23 | ////@end includes 24 | 25 | /*! 26 | * Forward declarations 27 | */ 28 | 29 | class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextColourSwatchCtrl; 30 | 31 | /*! 32 | * Control identifiers 33 | */ 34 | /// Control identifiers 35 | enum { 36 | ID_RICHTEXTBACKGROUNDPAGE = 10845, 37 | ID_RICHTEXT_BACKGROUND_COLOUR_CHECKBOX = 10846, 38 | ID_RICHTEXT_BACKGROUND_COLOUR_SWATCH = 10847 39 | }; 40 | 41 | ////@begin control identifiers 42 | #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE() wxTAB_TRAVERSAL 43 | #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_TITLE() wxEmptyString 44 | #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME() {.WxWindowID(ID_RICHTEXTBACKGROUNDPAGE).} 45 | #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE() constructWxSize(400, 300) 46 | #define SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION() wxDefaultPosition 47 | ////@end control identifiers 48 | 49 | 50 | /*! 51 | * wxRichTextBackgroundPage class declaration 52 | */ 53 | 54 | class WXDLLIMPEXP_RICHTEXT wxRichTextBackgroundPage: public wxRichTextDialogPage 55 | { 56 | public: 57 | /// Constructors 58 | wxRichTextBackgroundPage(); 59 | wxRichTextBackgroundPage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE ); 60 | 61 | /// Creation 62 | bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE ); 63 | 64 | /// Destructor 65 | ~wxRichTextBackgroundPage(); 66 | 67 | /// Initialises member variables 68 | void Init(); 69 | 70 | /// Creates the controls and sizers 71 | void CreateControls(); 72 | 73 | /// Gets the attributes from the formatting dialog 74 | wxRichTextAttr* GetAttributes(); 75 | 76 | /// Data transfer 77 | virtual bool TransferDataToWindow(); 78 | virtual bool TransferDataFromWindow(); 79 | 80 | /// Respond to colour swatch click 81 | void OnColourSwatch(wxCommandEvent& event); 82 | 83 | ////@begin wxRichTextBackgroundPage event handler declarations 84 | 85 | ////@end wxRichTextBackgroundPage event handler declarations 86 | 87 | ////@begin wxRichTextBackgroundPage member function declarations 88 | 89 | /// Retrieves bitmap resources 90 | wxBitmap GetBitmapResource( const wxString& name ); 91 | 92 | /// Retrieves icon resources 93 | wxIcon GetIconResource( const wxString& name ); 94 | ////@end wxRichTextBackgroundPage member function declarations 95 | 96 | ////@begin wxRichTextBackgroundPage member variables 97 | wxCheckBox* m_backgroundColourCheckBox; 98 | wxRichTextColourSwatchCtrl* m_backgroundColourSwatch; 99 | ////@end wxRichTextBackgroundPage member variables 100 | }; 101 | 102 | #endif 103 | // _RICHTEXTBACKGROUNDPAGE_H_ 104 | -------------------------------------------------------------------------------- /headers/richtext/richtextdialogpage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtextdialogpage.h 3 | // Purpose: Formatting dialog page base class for wxRTC 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 2010-11-14 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows Licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_RICHTEXTDIALOGPAGE_H_ 12 | #define _WX_RICHTEXTDIALOGPAGE_H_ 13 | 14 | #if wxUSE_RICHTEXT 15 | 16 | #include "wx/panel.h" 17 | #include "wx/richtext/richtextuicustomization.h" 18 | 19 | /** 20 | @class wxRichTextDialogPage 21 | The base class for formatting dialog pages. 22 | **/ 23 | 24 | class WXDLLIMPEXP_RICHTEXT wxRichTextDialogPage: public wxPanel 25 | { 26 | public: 27 | 28 | wxRichTextDialogPage() {} 29 | wxRichTextDialogPage(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0) 30 | { 31 | Create(parent, id, pos, size, style); 32 | } 33 | }; 34 | 35 | #endif 36 | // wxUSE_RICHTEXT 37 | 38 | #endif 39 | // _WX_RICHTEXTDIALOGPAGE_H_ 40 | -------------------------------------------------------------------------------- /headers/richtext/richtexthtml.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtexthtml.h 3 | // Purpose: HTML I/O for wxRichTextCtrl 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 2005-09-30 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_RICHTEXTHTML_H_ 12 | #define _WX_RICHTEXTHTML_H_ 13 | 14 | /*! 15 | * Includes 16 | */ 17 | 18 | #include "wx/richtext/richtextbuffer.h" 19 | 20 | // Use CSS styles where applicable, otherwise use non-CSS workarounds 21 | #define wxRICHTEXT_HANDLER_USE_CSS 0x1000 22 | 23 | /*! 24 | * wxRichTextHTMLHandler 25 | */ 26 | 27 | class WXDLLIMPEXP_RICHTEXT wxRichTextHTMLHandler: public wxRichTextFileHandler 28 | { 29 | 30 | 31 | public: 32 | wxRichTextHTMLHandler(const wxString& name = "HTML", 33 | const wxString& ext = "html", auto type = wxRICHTEXT_TYPE_HTML); 34 | 35 | /// Can we save using this handler? 36 | virtual bool CanSave() const { return true; } 37 | 38 | /// Can we load using this handler? 39 | virtual bool CanLoad() const { return false; } 40 | 41 | /// Can we handle this filename (if using files)? By default, checks the extension. 42 | virtual bool CanHandle(const wxString& filename) const; 43 | 44 | // Accessors and operations unique to this handler 45 | 46 | /// Set and get the list of image locations generated by the last operation 47 | void SetTemporaryImageLocations(const wxArrayString& locations) { m_imageLocations = locations; } 48 | const wxArrayString& GetTemporaryImageLocations() const { return m_imageLocations; } 49 | 50 | /// Clear the image locations generated by the last operation 51 | void ClearTemporaryImageLocations() { m_imageLocations.Clear(); } 52 | 53 | /// Delete the in-memory or temporary files generated by the last operation 54 | bool DeleteTemporaryImages(); 55 | 56 | /// Delete the in-memory or temporary files generated by the last operation. This is a static 57 | /// function that can be used to delete the saved locations from an earlier operation, 58 | /// for example after the user has viewed the HTML file. 59 | static bool DeleteTemporaryImages(int flags, const wxArrayString& imageLocations); 60 | 61 | /// Reset the file counter, in case, for example, the same names are required each time 62 | static void SetFileCounter(int counter) { sm_fileCounter = counter; } 63 | 64 | /// Set and get the directory for storing temporary files. If empty, the system 65 | /// temporary directory will be used. 66 | void SetTempDir(const wxString& tempDir) { m_tempDir = tempDir; } 67 | const wxString& GetTempDir() const { return m_tempDir; } 68 | 69 | /// Set and get mapping from point size to HTML font size. There should be 7 elements, 70 | /// one for each HTML font size, each element specifying the maximum point size for that 71 | /// HTML font size. E.g. 8, 10, 13, 17, 22, 29, 100 72 | void SetFontSizeMapping(const wxArrayInt& fontSizeMapping) { m_fontSizeMapping = fontSizeMapping; } 73 | wxArrayInt GetFontSizeMapping() const { return m_fontSizeMapping; } 74 | 75 | protected: 76 | 77 | // Implementation 78 | 79 | // Data members 80 | 81 | wxRichTextBuffer* m_buffer; 82 | 83 | /// Indentation values of the table tags 84 | wxArrayInt m_indents; 85 | 86 | /// Stack of list types: 0 = ol, 1 = ul 87 | wxArrayInt m_listTypes; 88 | 89 | /// Is there any opened font tag? 90 | bool m_font; 91 | 92 | /// Are we in a table? 93 | bool m_inTable; 94 | 95 | /// A list of the image files or in-memory images created by the last operation. 96 | wxArrayString m_imageLocations; 97 | 98 | /// A location for the temporary files 99 | wxString m_tempDir; 100 | 101 | /// A mapping from point size to HTML font size 102 | wxArrayInt m_fontSizeMapping; 103 | 104 | /// A counter for generating filenames 105 | static int sm_fileCounter; 106 | }; 107 | 108 | #endif 109 | // _WX_RICHTEXTXML_H_ 110 | -------------------------------------------------------------------------------- /headers/richtext/richtextimagedlg.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtextimagedlg.h 3 | // Purpose: 4 | // Author: Mingquan Yang 5 | // Modified by: Julian Smart 6 | // Created: Wed 02 Jun 2010 11:27:23 CST 7 | // RCS-ID: 8 | // Copyright: (c) Mingquan Yang, Julian Smart 9 | // Licence: wxWindows licence 10 | ///////////////////////////////////////////////////////////////////////////// 11 | 12 | #include "wx/dialog.h" 13 | 14 | #ifndef _RICHTEXTIMAGEDLG_H_ 15 | #define _RICHTEXTIMAGEDLG_H_ 16 | 17 | /*! 18 | * Forward declarations 19 | */ 20 | 21 | class WXDLLIMPEXP_FWD_CORE wxButton; 22 | class WXDLLIMPEXP_FWD_CORE wxComboBox; 23 | class WXDLLIMPEXP_FWD_CORE wxCheckBox; 24 | class WXDLLIMPEXP_FWD_CORE wxTextCtrl; 25 | 26 | /*! 27 | * Includes 28 | */ 29 | 30 | #include "wx/richtext/richtextbuffer.h" 31 | #include "wx/richtext/richtextformatdlg.h" 32 | 33 | /*! 34 | * Control identifiers 35 | */ 36 | enum { 37 | ID_RICHTEXTOBJECTPROPERTIESDIALOG = 10650 38 | }; 39 | 40 | #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE() wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL 41 | #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE() "Object Properties" 42 | #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME() {.WxWindowID(ID_RICHTEXTOBJECTPROPERTIESDIALOG).} 43 | #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE() constructWxSize(400, 300) 44 | #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION() wxDefaultPosition 45 | 46 | /*! 47 | * wxRichTextObjectPropertiesDialog class declaration 48 | */ 49 | 50 | class WXDLLIMPEXP_RICHTEXT wxRichTextObjectPropertiesDialog: public wxRichTextFormattingDialog 51 | { 52 | public: 53 | /// Constructors 54 | wxRichTextObjectPropertiesDialog(); 55 | wxRichTextObjectPropertiesDialog( wxRichTextObject* obj, wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE ); 56 | 57 | /// Creation 58 | bool Create( wxRichTextObject* obj, wxWindow* parent, 59 | wxWindowID id = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE ); 60 | 61 | /// Destructor 62 | ~wxRichTextObjectPropertiesDialog(); 63 | 64 | /// Initialises member variables 65 | void Init(); 66 | 67 | /// Creates the controls and sizers 68 | void CreateControls(); 69 | 70 | ////@begin wxRichTextObjectPropertiesDialog event handler declarations 71 | 72 | ////@end wxRichTextObjectPropertiesDialog event handler declarations 73 | 74 | ////@begin wxRichTextObjectPropertiesDialog member function declarations 75 | 76 | /// Retrieves bitmap resources 77 | wxBitmap GetBitmapResource( const wxString& name ); 78 | 79 | /// Retrieves icon resources 80 | wxIcon GetIconResource( const wxString& name ); 81 | ////@end wxRichTextObjectPropertiesDialog member function declarations 82 | 83 | ////@begin wxRichTextObjectPropertiesDialog member variables 84 | /// Control identifiers 85 | ////@end wxRichTextObjectPropertiesDialog member variables 86 | }; 87 | 88 | #endif 89 | // _RICHTEXTIMAGEDLG_H_ 90 | -------------------------------------------------------------------------------- /headers/richtext/richtextstylepage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtextstylepage.h 3 | // Purpose: 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 10/5/2006 11:34:55 AM 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _RICHTEXTSTYLEPAGE_H_ 12 | #define _RICHTEXTSTYLEPAGE_H_ 13 | 14 | #include "wx/richtext/richtextdialogpage.h" 15 | 16 | /*! 17 | * Control identifiers 18 | */ 19 | /// Control identifiers 20 | enum { 21 | ID_RICHTEXTSTYLEPAGE = 10403, 22 | ID_RICHTEXTSTYLEPAGE_STYLE_NAME = 10404, 23 | ID_RICHTEXTSTYLEPAGE_BASED_ON = 10405, 24 | ID_RICHTEXTSTYLEPAGE_NEXT_STYLE = 10406 25 | }; 26 | 27 | 28 | ////@begin control identifiers 29 | #define SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE() wxRESIZE_BORDER|wxTAB_TRAVERSAL 30 | #define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE() wxEmptyString 31 | #define SYMBOL_WXRICHTEXTSTYLEPAGE_IDNAME() {.WxWindowID(ID_RICHTEXTSTYLEPAGE).} 32 | #define SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE() constructwxSize(400, 300) 33 | #define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION() wxDefaultPosition 34 | ////@end control identifiers 35 | 36 | /*! 37 | * wxRichTextStylePage class declaration 38 | */ 39 | 40 | class WXDLLIMPEXP_RICHTEXT wxRichTextStylePage: public wxRichTextDialogPage 41 | { 42 | public: 43 | /// Constructors 44 | wxRichTextStylePage( ); 45 | wxRichTextStylePage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); 46 | 47 | /// Creation 48 | bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); 49 | 50 | /// Initialise members 51 | void Init(); 52 | 53 | /// Creates the controls and sizers 54 | void CreateControls(); 55 | 56 | /// Transfer data from/to window 57 | virtual bool TransferDataFromWindow(); 58 | virtual bool TransferDataToWindow(); 59 | 60 | /// Gets the attributes associated with the main formatting dialog 61 | wxRichTextAttr* GetAttributes(); 62 | 63 | ////@begin wxRichTextStylePage event handler declarations 64 | 65 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEPAGE_NEXT_STYLE 66 | void OnNextStyleUpdate( wxUpdateUIEvent& event ); 67 | 68 | ////@end wxRichTextStylePage event handler declarations 69 | 70 | ////@begin wxRichTextStylePage member function declarations 71 | 72 | /// Retrieves bitmap resources 73 | wxBitmap GetBitmapResource( const wxString& name ); 74 | 75 | /// Retrieves icon resources 76 | wxIcon GetIconResource( const wxString& name ); 77 | ////@end wxRichTextStylePage member function declarations 78 | 79 | 80 | ////@begin wxRichTextStylePage member variables 81 | wxTextCtrl* m_styleName; 82 | wxComboBox* m_basedOn; 83 | wxComboBox* m_nextStyle; 84 | ////@end wxRichTextStylePage member variables 85 | }; 86 | 87 | #endif 88 | // _RICHTEXTSTYLEPAGE_H_ 89 | -------------------------------------------------------------------------------- /headers/richtext/richtexttabspage.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtext/richtexttabspage.h 3 | // Purpose: 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 10/4/2006 8:03:20 AM 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _RICHTEXTTABSPAGE_H_ 12 | #define _RICHTEXTTABSPAGE_H_ 13 | 14 | /*! 15 | * Includes 16 | */ 17 | 18 | #include "wx/richtext/richtextdialogpage.h" 19 | 20 | ////@begin includes 21 | ////@end includes 22 | 23 | /*! 24 | * Forward declarations 25 | */ 26 | 27 | ////@begin forward declarations 28 | ////@end forward declarations 29 | 30 | /*! 31 | * Control identifiers 32 | */ 33 | /// Control identifiers 34 | enum { 35 | ID_RICHTEXTTABSPAGE = 10200, 36 | ID_RICHTEXTTABSPAGE_TABEDIT = 10213, 37 | ID_RICHTEXTTABSPAGE_TABLIST = 10214, 38 | ID_RICHTEXTTABSPAGE_NEW_TAB = 10201, 39 | ID_RICHTEXTTABSPAGE_DELETE_TAB = 10202, 40 | ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS = 10203 41 | }; 42 | 43 | ////@begin control identifiers 44 | #define SYMBOL_WXRICHTEXTTABSPAGE_STYLE() wxRESIZE_BORDER|wxTAB_TRAVERSAL 45 | #define SYMBOL_WXRICHTEXTTABSPAGE_TITLE() wxEmptyString 46 | #define SYMBOL_WXRICHTEXTTABSPAGE_IDNAME() ID_RICHTEXTTABSPAGE 47 | #define SYMBOL_WXRICHTEXTTABSPAGE_SIZE() constructwxSize(400, 300) 48 | #define SYMBOL_WXRICHTEXTTABSPAGE_POSITION() wxDefaultPosition 49 | ////@end control identifiers 50 | 51 | /*! 52 | * wxRichTextTabsPage class declaration 53 | */ 54 | 55 | class WXDLLIMPEXP_RICHTEXT wxRichTextTabsPage: public wxRichTextDialogPage 56 | { 57 | public: 58 | /// Constructors 59 | wxRichTextTabsPage( ); 60 | wxRichTextTabsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); 61 | 62 | /// Creation 63 | bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); 64 | 65 | /// Creates the controls and sizers 66 | void CreateControls(); 67 | 68 | /// Initialise members 69 | void Init(); 70 | 71 | /// Transfer data from/to window 72 | virtual bool TransferDataFromWindow(); 73 | virtual bool TransferDataToWindow(); 74 | 75 | /// Sorts the tab array 76 | virtual void SortTabs(); 77 | 78 | /// Gets the attributes associated with the main formatting dialog 79 | wxRichTextAttr* GetAttributes(); 80 | 81 | ////@begin wxRichTextTabsPage event handler declarations 82 | 83 | /// wxEVT_LISTBOX event handler for ID_RICHTEXTTABSPAGE_TABLIST 84 | void OnTablistSelected( wxCommandEvent& event ); 85 | 86 | /// wxEVT_BUTTON event handler for ID_RICHTEXTTABSPAGE_NEW_TAB 87 | void OnNewTabClick( wxCommandEvent& event ); 88 | 89 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_NEW_TAB 90 | void OnNewTabUpdate( wxUpdateUIEvent& event ); 91 | 92 | /// wxEVT_BUTTON event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB 93 | void OnDeleteTabClick( wxCommandEvent& event ); 94 | 95 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB 96 | void OnDeleteTabUpdate( wxUpdateUIEvent& event ); 97 | 98 | /// wxEVT_BUTTON event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS 99 | void OnDeleteAllTabsClick( wxCommandEvent& event ); 100 | 101 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS 102 | void OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ); 103 | 104 | ////@end wxRichTextTabsPage event handler declarations 105 | 106 | ////@begin wxRichTextTabsPage member function declarations 107 | 108 | /// Retrieves bitmap resources 109 | wxBitmap GetBitmapResource( const wxString& name ); 110 | 111 | /// Retrieves icon resources 112 | wxIcon GetIconResource( const wxString& name ); 113 | ////@end wxRichTextTabsPage member function declarations 114 | 115 | ////@begin wxRichTextTabsPage member variables 116 | wxTextCtrl* m_tabEditCtrl; 117 | wxListBox* m_tabListCtrl; 118 | ////@end wxRichTextTabsPage member variables 119 | 120 | bool m_tabsPresent; 121 | }; 122 | 123 | #endif 124 | // _RICHTEXTTABSPAGE_H_ 125 | -------------------------------------------------------------------------------- /headers/richtooltip.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/richtooltip.h 3 | // Purpose: Declaration of wxRichToolTip class. 4 | // Author: Vadim Zeitlin 5 | // Created: 2011-10-07 6 | // Copyright: (c) 2011 Vadim Zeitlin 7 | // Licence: wxWindows licence 8 | /////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef _WX_RICHTOOLTIP_H_ 11 | #define _WX_RICHTOOLTIP_H_ 12 | 13 | #include "wx/defs.h" 14 | 15 | #if wxUSE_RICHTOOLTIP 16 | 17 | #include "wx/colour.h" 18 | 19 | class WXDLLIMPEXP_FWD_CORE wxFont; 20 | class WXDLLIMPEXP_FWD_CORE wxIcon; 21 | class WXDLLIMPEXP_FWD_CORE wxWindow; 22 | 23 | class wxRichToolTipImpl; 24 | 25 | // This enum describes the kind of the tip shown which combines both the tip 26 | // position and appearance because the two are related (when the tip is 27 | // positioned asymmetrically, a right handed triangle is used but an 28 | // equilateral one when it's in the middle of a side). 29 | // 30 | // Automatic selects the tip appearance best suited for the current platform 31 | // and the position best suited for the window the tooltip is shown for, i.e. 32 | // chosen in such a way that the tooltip is always fully on screen. 33 | // 34 | // Other values describe the position of the tooltip itself, not the window it 35 | // relates to. E.g. wxTipKind_Top places the tip on the top of the tooltip and 36 | // so the tooltip itself is located beneath its associated window. 37 | enum wxTipKind 38 | { 39 | wxTipKind_None, 40 | wxTipKind_TopLeft, 41 | wxTipKind_Top, 42 | wxTipKind_TopRight, 43 | wxTipKind_BottomLeft, 44 | wxTipKind_Bottom, 45 | wxTipKind_BottomRight, 46 | wxTipKind_Auto 47 | }; 48 | 49 | // ---------------------------------------------------------------------------- 50 | // wxRichToolTip: a customizable but not necessarily native tooltip. 51 | // ---------------------------------------------------------------------------- 52 | 53 | // Notice that this class does not inherit from wxWindow. 54 | class WXDLLIMPEXP_ADV wxRichToolTip 55 | { 56 | public: 57 | // Ctor must specify the tooltip title and main message, additional 58 | // attributes can be set later. 59 | wxRichToolTip(const wxString& title, const wxString& message); 60 | 61 | // Set the background colour: if two colours are specified, the background 62 | // is drawn using a gradient from top to bottom, otherwise a single solid 63 | // colour is used. 64 | void SetBackgroundColour(const wxColour& col, 65 | const wxColour& colEnd = wxColour()); 66 | 67 | // Set the small icon to show: either one of the standard information/ 68 | // warning/error ones (the question icon doesn't make sense for a tooltip) 69 | // or a custom icon. 70 | void SetIcon(int icon = wxICON_INFORMATION); 71 | void SetIcon(const wxIcon& icon); 72 | 73 | // Set timeout after which the tooltip should disappear, in milliseconds. 74 | // By default the tooltip is hidden after system-dependent interval of time 75 | // elapses but this method can be used to change this or also disable 76 | // hiding the tooltip automatically entirely by passing 0 in this parameter 77 | // (but doing this can result in native version not being used). 78 | // Optionally specify a show delay. 79 | void SetTimeout(unsigned milliseconds, unsigned millisecondsShowdelay = 0); 80 | 81 | // Choose the tip kind, possibly none. By default the tip is positioned 82 | // automatically, as if wxTipKind_Auto was used. 83 | void SetTipKind(wxTipKind tipKind); 84 | 85 | // Set the title text font. By default it's emphasized using the font style 86 | // or colour appropriate for the current platform. 87 | void SetTitleFont(const wxFont& font); 88 | 89 | // Show the tooltip for the given window and optionally a specified area. 90 | void ShowFor(wxWindow* win, const wxRect* rect = NULL); 91 | 92 | // Non-virtual dtor as this class is not supposed to be derived from. 93 | ~wxRichToolTip(); 94 | 95 | private: 96 | wxRichToolTipImpl* const m_impl; 97 | 98 | wxDECLARE_NO_COPY_CLASS(wxRichToolTip); 99 | }; 100 | 101 | #endif // wxUSE_RICHTOOLTIP 102 | 103 | #endif // _WX_RICHTOOLTIP_H_ 104 | -------------------------------------------------------------------------------- /headers/scrolbar.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/scrolbar.h 3 | // Purpose: wxScrollBar base header 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_SCROLBAR_H_BASE_ 12 | #define _WX_SCROLBAR_H_BASE_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_SCROLLBAR 17 | 18 | #include "wx/control.h" 19 | 20 | // ---------------------------------------------------------------------------- 21 | // wxScrollBar: a scroll bar control 22 | // ---------------------------------------------------------------------------- 23 | 24 | class WXDLLIMPEXP_CORE wxScrollBarBase : public wxControl 25 | { 26 | public: 27 | wxScrollBarBase() { } 28 | 29 | /* 30 | Derived classes should provide the following method and ctor with the 31 | same parameters: 32 | 33 | bool Create(wxWindow *parent, 34 | wxWindowID id, 35 | const wxPoint& pos = wxDefaultPosition, 36 | const wxSize& size = wxDefaultSize, 37 | long style = wxSB_HORIZONTAL, 38 | const wxValidator& validator = wxDefaultValidator, 39 | const wxString& name = wxScrollBarNameStr); 40 | */ 41 | 42 | // accessors 43 | virtual int GetThumbPosition() const = 0; 44 | virtual int GetThumbSize() const = 0; 45 | virtual int GetPageSize() const = 0; 46 | virtual int GetRange() const = 0; 47 | 48 | bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; } 49 | 50 | // operations 51 | virtual void SetThumbPosition(int viewStart) = 0; 52 | virtual void SetScrollbar(int position, int thumbSize, 53 | int range, int pageSize, 54 | bool refresh = true) = 0; 55 | 56 | // implementation-only 57 | bool IsNeeded() const { return GetRange() > GetThumbSize(); } 58 | 59 | private: 60 | wxDECLARE_NO_COPY_CLASS(wxScrollBarBase); 61 | }; 62 | 63 | 64 | #endif // wxUSE_SCROLLBAR 65 | 66 | #endif 67 | // _WX_SCROLBAR_H_BASE_ 68 | -------------------------------------------------------------------------------- /headers/statbox.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: statbox.h 3 | // Purpose: interface of wxStaticBox 4 | // Author: wxWidgets team 5 | // Licence: wxWindows licence 6 | ///////////////////////////////////////////////////////////////////////////// 7 | 8 | /** 9 | @class wxStaticBox 10 | 11 | A static box is a rectangle drawn around other windows to denote 12 | a logical grouping of items. 13 | 14 | Note that while the previous versions required that windows appearing 15 | inside a static box be created as its siblings (i.e. use the same parent as 16 | the static box itself), since wxWidgets 2.9.1 it is also possible to create 17 | them as children of wxStaticBox itself and you are actually encouraged to 18 | do it like this if compatibility with the previous versions is not 19 | important. 20 | 21 | So the new recommended way to create static box is: 22 | @code 23 | void MyFrame::CreateControls() 24 | { 25 | wxPanel *panel = new wxPanel(this); 26 | wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox"); 27 | 28 | new wxStaticText(box, wxID_ANY "This window is a child of the staticbox"); 29 | ... 30 | } 31 | @endcode 32 | 33 | While the compatible -- and now deprecated -- way is 34 | @code 35 | wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox"); 36 | 37 | new wxStaticText(panel, wxID_ANY "This window is a child of the panel"); 38 | ... 39 | @endcode 40 | 41 | Also note that there is a specialized wxSizer class (wxStaticBoxSizer) which can 42 | be used as an easier way to pack items into a static box. 43 | 44 | @library{wxcore} 45 | @category{ctrl} 46 | @appearance{staticbox} 47 | 48 | @see wxStaticText, wxStaticBoxSizer 49 | */ 50 | class wxStaticBox : public wxControl 51 | { 52 | public: 53 | /** 54 | Default constructor 55 | */ 56 | wxStaticBox(); 57 | 58 | /** 59 | Constructor, creating and showing a static box. 60 | 61 | @param parent 62 | Parent window. Must not be @NULL. 63 | @param id 64 | Window identifier. The value wxID_ANY indicates a default value. 65 | @param label 66 | Text to be displayed in the static box, the empty string for no label. 67 | @param pos 68 | Window position. 69 | If ::wxDefaultPosition is specified then a default position is chosen. 70 | @param size 71 | Checkbox size. 72 | If ::wxDefaultSize is specified then a default size is chosen. 73 | @param style 74 | Window style. See wxStaticBox. 75 | @param name 76 | Window name. 77 | 78 | @see Create() 79 | */ 80 | wxStaticBox(wxWindow* parent, wxWindowID id, 81 | const wxString& label, 82 | const wxPoint& pos = wxDefaultPosition, 83 | const wxSize& size = wxDefaultSize, 84 | long style = 0, 85 | const wxString& name = wxStaticBoxNameStr); 86 | 87 | /** 88 | Destructor, destroying the group box. 89 | */ 90 | virtual ~wxStaticBox(); 91 | 92 | /** 93 | Creates the static box for two-step construction. 94 | See wxStaticBox() for further details. 95 | */ 96 | bool Create(wxWindow* parent, wxWindowID id, const wxString& label, 97 | const wxPoint& pos = wxDefaultPosition, 98 | const wxSize& size = wxDefaultSize, long style = 0, 99 | const wxString& name = wxStaticBoxNameStr); 100 | }; 101 | 102 | -------------------------------------------------------------------------------- /headers/stattext.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/stattext.h 3 | // Purpose: wxStaticText base header 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_STATTEXT_H_BASE_ 12 | #define _WX_STATTEXT_H_BASE_ 13 | 14 | #include "wx/defs.h" 15 | 16 | #if wxUSE_STATTEXT 17 | 18 | #include "wx/control.h" 19 | 20 | /* 21 | * wxStaticText flags 22 | */ 23 | #define wxST_NO_AUTORESIZE 0x0001 24 | // free 0x0002 bit 25 | #define wxST_ELLIPSIZE_START 0x0004 26 | #define wxST_ELLIPSIZE_MIDDLE 0x0008 27 | #define wxST_ELLIPSIZE_END 0x0010 28 | 29 | class WXDLLIMPEXP_CORE wxStaticTextBase : public wxControl 30 | { 31 | public: 32 | wxStaticTextBase() { } 33 | 34 | // wrap the text of the control so that no line is longer than the given 35 | // width (if possible: this function won't break words) 36 | // This function will modify the value returned by GetLabel()! 37 | void Wrap(int width); 38 | 39 | // overridden base virtuals 40 | virtual bool AcceptsFocus() const { return false; } 41 | virtual bool HasTransparentBackground() { return true; } 42 | 43 | bool IsEllipsized() const 44 | { 45 | return HasFlag(wxST_ELLIPSIZE_START) || 46 | HasFlag(wxST_ELLIPSIZE_MIDDLE) || 47 | HasFlag(wxST_ELLIPSIZE_END); 48 | } 49 | 50 | protected: // functions required for wxST_ELLIPSIZE_* support 51 | 52 | // choose the default border for this window 53 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } 54 | 55 | // Calls Ellipsize() on the real label if necessary. Unlike GetLabelText(), 56 | // keeps the mnemonics instead of removing them. 57 | virtual wxString GetEllipsizedLabel() const; 58 | 59 | // Replaces parts of the string with ellipsis according to the ellipsize 60 | // style. Shouldn't be called if we don't have any. 61 | wxString Ellipsize(const wxString& label) const; 62 | 63 | // to be called when updating the size of the static text: 64 | // updates the label redoing ellipsization calculations 65 | void UpdateLabel(); 66 | 67 | // These functions are platform-specific and must be overridden in ports 68 | // which do not natively support ellipsization and they must be implemented 69 | // in a way so that the m_labelOrig member of wxControl is not touched: 70 | 71 | // returns the real label currently displayed inside the control. 72 | virtual wxString DoGetLabel() const { return wxEmptyString; } 73 | 74 | // sets the real label currently displayed inside the control, 75 | // _without_ invalidating the size. The text passed is always markup-free 76 | // but may contain the mnemonic characters. 77 | virtual void DoSetLabel(const wxString& WXUNUSED(str)) { } 78 | 79 | private: 80 | wxDECLARE_NO_COPY_CLASS(wxStaticTextBase); 81 | }; 82 | 83 | class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase 84 | { 85 | public: 86 | wxStaticText() { } 87 | 88 | wxStaticText(wxWindow *parent, 89 | wxWindowID id, 90 | const wxString& label, 91 | const wxPoint& pos = wxDefaultPosition, 92 | const wxSize& size = wxDefaultSize, 93 | long style = 0, 94 | const wxString& name = wxStaticTextNameStr) 95 | { 96 | Create(parent, id, label, pos, size, style, name); 97 | } 98 | 99 | bool Create(wxWindow *parent, 100 | wxWindowID id, 101 | const wxString& label, 102 | const wxPoint& pos = wxDefaultPosition, 103 | const wxSize& size = wxDefaultSize, 104 | long style = 0, 105 | const wxString& name = wxStaticTextNameStr); 106 | 107 | // override some methods to resize the window properly 108 | virtual void SetLabel(const wxString& label); 109 | virtual bool SetFont( const wxFont &font ); 110 | 111 | protected: 112 | // implement/override some base class virtuals 113 | virtual void DoSetSize(int x, int y, int w, int h, 114 | int sizeFlags = wxSIZE_AUTO); 115 | virtual wxSize DoGetBestClientSize() const; 116 | 117 | virtual wxString DoGetLabel() const; 118 | virtual void DoSetLabel(const wxString& str); 119 | 120 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText) 121 | }; 122 | 123 | #endif // wxUSE_STATTEXT 124 | 125 | #endif // _WX_STATTEXT_H_BASE_ 126 | -------------------------------------------------------------------------------- /headers/types.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: wx/types.h 3 | // Purpose: Type identifiers, used by resource system 4 | // Author: Julian Smart 5 | // Modified by: 6 | // Created: 01/02/97 7 | // Copyright: (c) Julian Smart 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_TYPESH__ 12 | #define _WX_TYPESH__ 13 | 14 | // Types of objects 15 | #define wxTYPE_ANY 0 16 | #define wxTYPE_OBJECT wxTYPE_ANY 17 | #define wxTYPE_WINDOW 1 18 | #define wxTYPE_DIALOG_BOX 2 19 | #define wxTYPE_ITEM 3 20 | #define wxTYPE_PANEL 4 21 | #define wxTYPE_CANVAS 5 22 | #define wxTYPE_TEXT_WINDOW 6 23 | #define wxTYPE_FRAME 7 24 | 25 | #define wxTYPE_BUTTON 8 26 | #define wxTYPE_TEXT 9 27 | #define wxTYPE_MESSAGE 10 28 | #define wxTYPE_CHOICE 11 29 | #define wxTYPE_LIST_BOX 12 30 | #define wxTYPE_SLIDER 13 31 | #define wxTYPE_CHECK_BOX 14 32 | #define wxTYPE_MENU 15 33 | #define wxTYPE_MENU_BAR 16 34 | #define wxTYPE_MULTI_TEXT 17 35 | #define wxTYPE_RADIO_BOX 18 36 | #define wxTYPE_GROUP_BOX 19 37 | #define wxTYPE_GAUGE 20 38 | #define wxTYPE_SCROLL_BAR 21 39 | #define wxTYPE_VIRT_LIST_BOX 22 40 | #define wxTYPE_COMBO_BOX 23 41 | #define wxTYPE_RADIO_BUTTON 24 42 | 43 | #define wxTYPE_EVENT 25 44 | #define wxTYPE_DC 26 45 | #define wxTYPE_DC_CANVAS 27 46 | #define wxTYPE_DC_POSTSCRIPT 28 47 | #define wxTYPE_DC_PRINTER 29 48 | #define wxTYPE_DC_METAFILE 30 49 | #define wxTYPE_DC_MEMORY 31 50 | #define wxTYPE_MOUSE_EVENT 32 51 | #define wxTYPE_KEY_EVENT 33 52 | #define wxTYPE_COMMAND_EVENT 34 53 | #define wxTYPE_DC_PANEL 35 54 | 55 | #define wxTYPE_PEN 40 56 | #define wxTYPE_BRUSH 41 57 | #define wxTYPE_FONT 42 58 | #define wxTYPE_ICON 42 59 | #define wxTYPE_BITMAP 43 60 | #define wxTYPE_METAFILE 44 61 | #define wxTYPE_TIMER 45 62 | #define wxTYPE_COLOUR 46 63 | #define wxTYPE_COLOURMAP 47 64 | #define wxTYPE_CURSOR 48 65 | 66 | #define wxTYPE_DDE_CLIENT 60 67 | #define wxTYPE_DDE_SERVER 61 68 | #define wxTYPE_DDE_CONNECTION 62 69 | 70 | #define wxTYPE_HELP_INSTANCE 63 71 | 72 | #define wxTYPE_LIST 70 73 | #define wxTYPE_STRING_LIST 71 74 | #define wxTYPE_HASH_TABLE 72 75 | #define wxTYPE_NODE 73 76 | #define wxTYPE_APP 74 77 | #define wxTYPE_DATE 75 78 | 79 | #define wxTYPE_ENHANCED_DIALOG 80 80 | #define wxTYPE_TOOLBAR 81 81 | #define wxTYPE_BUTTONBAR 82 82 | 83 | #define wxTYPE_DATABASE 90 84 | #define wxTYPE_QUERY_FIELD 91 85 | #define wxTYPE_QUERY_COL 92 86 | #define wxTYPE_RECORDSET 93 87 | 88 | #define wxTYPE_USER 500 89 | 90 | #endif 91 | // _WX_TYPESH__ 92 | 93 | -------------------------------------------------------------------------------- /screenshots/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PMunch/wxnim/64776687361c7381a80e27c042e4deaadc11772d/screenshots/linux.png -------------------------------------------------------------------------------- /screenshots/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PMunch/wxnim/64776687361c7381a80e27c042e4deaadc11772d/screenshots/windows.png -------------------------------------------------------------------------------- /screenshots/x11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PMunch/wxnim/64776687361c7381a80e27c042e4deaadc11772d/screenshots/x11.png -------------------------------------------------------------------------------- /scripts/convert.nim: -------------------------------------------------------------------------------- 1 | 2 | import os, strutils 3 | 4 | const whatif = false 5 | 6 | proc exec(cmd: string) = 7 | when whatif: 8 | echo cmd 9 | else: 10 | if os.execShellCmd(cmd) != 0: 11 | echo "FAILURE ", cmd 12 | else: 13 | echo "SUCCESS ", cmd 14 | 15 | when not declared(os.tailDir): 16 | proc tailDir(path: string): string = 17 | var q = 1 18 | if len(path) >= 1 and path[len(path)-1] in {DirSep, AltSep}: q = 2 19 | for i in 0..len(path)-q: 20 | if path[i] in {DirSep, AltSep}: 21 | return substr(path, i+1) 22 | result = "" 23 | 24 | proc main(dir: string; rec: bool) = 25 | for kind, file in walkDir(dir): 26 | case kind 27 | of pcDir: 28 | if rec: main(file, rec) 29 | of pcFile: 30 | if file.endswith(".h"): 31 | exec "c2nim headers/wx.c2nim " & file & 32 | " --out:private" / file.tailDir.changeFileExt("nim") 33 | else: discard 34 | 35 | main("headers", true) 36 | -------------------------------------------------------------------------------- /wxnim.nimble: -------------------------------------------------------------------------------- 1 | # Package 2 | version = "0.9.1" 3 | author = "Andreas Rumpf and Peter Munch-Ellingsen" 4 | description = "Nim wrapper for wxWidgets" 5 | license = "MIT" 6 | 7 | # Deps 8 | requires "nim >= 0.17.0" 9 | -------------------------------------------------------------------------------- /wxnim/driver.nim: -------------------------------------------------------------------------------- 1 | 2 | {.emit: """ 3 | 4 | #include 5 | #ifndef WX_PRECOMP 6 | #include 7 | #endif 8 | class MyApp: public wxApp 9 | { 10 | public: 11 | virtual bool OnInit() { return true; } 12 | }; 13 | """.} 14 | 15 | proc init = 16 | {.emit: """ 17 | wxApp::SetInstance(new MyApp()); 18 | int dummy = 0; 19 | wxEntryStart(dummy, (char**) NULL); 20 | wxTheApp->OnInit(); 21 | """.} 22 | 23 | init() 24 | 25 | proc runMainLoop*() = 26 | {.emit: """ 27 | wxTheApp->OnRun(); 28 | wxTheApp->OnExit(); 29 | wxEntryCleanup(); 30 | """.} 31 | -------------------------------------------------------------------------------- /wxnim/private/anybutton.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxBU_LEFT* = 0x00000040 6 | wxBU_TOP* = 0x00000080 7 | wxBU_RIGHT* = 0x00000100 8 | wxBU_BOTTOM* = 0x00000200 9 | wxBU_ALIGN_MASK* = (wxBU_LEFT or wxBU_TOP or wxBU_RIGHT or wxBU_BOTTOM) 10 | 11 | 12 | const 13 | wxBU_NOAUTODRAW* = 0x00000000 14 | wxBU_AUTODRAW* = 0x00000004 15 | 16 | 17 | const 18 | wxBU_EXACTFIT* = 0x00000001 19 | 20 | 21 | const 22 | wxBU_NOTEXT* = 0x00000002 23 | 24 | 25 | type 26 | WxAnyButtonBase* {.importcpp: "wxAnyButtonBase", header: wxh.} = object of WxControl 27 | 28 | 29 | proc constructwxAnyButtonBase*(): WxAnyButtonBase {.cdecl, constructor, 30 | importcpp: "wxAnyButtonBase(@)", header: wxh.} 31 | proc setBitmap*(this: var WxAnyButtonBase; bitmap: WxBitmap; 32 | dir: WxDirection = wxLEFT) {.cdecl, importcpp: "SetBitmap", 33 | header: wxh.} 34 | proc getBitmap*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 35 | importcpp: "GetBitmap", header: wxh.} 36 | proc setBitmapLabel*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 37 | importcpp: "SetBitmapLabel", header: wxh.} 38 | proc setBitmapPressed*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 39 | importcpp: "SetBitmapPressed", header: wxh.} 40 | proc setBitmapDisabled*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 41 | importcpp: "SetBitmapDisabled", header: wxh.} 42 | proc setBitmapCurrent*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 43 | importcpp: "SetBitmapCurrent", header: wxh.} 44 | proc setBitmapFocus*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 45 | importcpp: "SetBitmapFocus", header: wxh.} 46 | proc getBitmapLabel*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 47 | importcpp: "GetBitmapLabel", header: wxh.} 48 | proc getBitmapPressed*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 49 | importcpp: "GetBitmapPressed", header: wxh.} 50 | proc getBitmapDisabled*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 51 | importcpp: "GetBitmapDisabled", header: wxh.} 52 | proc getBitmapCurrent*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 53 | importcpp: "GetBitmapCurrent", header: wxh.} 54 | proc getBitmapFocus*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 55 | importcpp: "GetBitmapFocus", header: wxh.} 56 | proc setBitmapMargins*(this: var WxAnyButtonBase; x: WxCoord; y: WxCoord) {. 57 | cdecl, importcpp: "SetBitmapMargins", header: wxh.} 58 | proc setBitmapMargins*(this: var WxAnyButtonBase; sz: WxSize) {.cdecl, 59 | importcpp: "SetBitmapMargins", header: wxh.} 60 | proc getBitmapMargins*(this: var WxAnyButtonBase): WxSize {.cdecl, 61 | importcpp: "GetBitmapMargins", header: wxh.} 62 | proc setBitmapPosition*(this: var WxAnyButtonBase; dir: WxDirection) {.cdecl, 63 | importcpp: "SetBitmapPosition", header: wxh.} 64 | proc shouldInheritColours*(this: WxAnyButtonBase): bool {.noSideEffect, cdecl, 65 | importcpp: "ShouldInheritColours", header: wxh.} 66 | proc getBitmapSelected*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 67 | importcpp: "GetBitmapSelected", header: wxh.} 68 | proc getBitmapHover*(this: WxAnyButtonBase): WxBitmap {.noSideEffect, cdecl, 69 | importcpp: "GetBitmapHover", header: wxh.} 70 | proc setBitmapSelected*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 71 | importcpp: "SetBitmapSelected", header: wxh.} 72 | proc setBitmapHover*(this: var WxAnyButtonBase; bitmap: WxBitmap) {.cdecl, 73 | importcpp: "SetBitmapHover", header: wxh.} 74 | type 75 | State* {.size: sizeof(cint), importcpp: "wxAnyButtonBase::State", header: wxh.} = enum 76 | StateNormal, StateCurrent, StatePressed, StateDisabled, StateFocused, 77 | StateMax 78 | 79 | 80 | proc dontShowLabel*(this: WxAnyButtonBase): bool {.noSideEffect, cdecl, 81 | importcpp: "DontShowLabel", header: wxh.} 82 | proc showsLabel*(this: WxAnyButtonBase): bool {.discardable, noSideEffect, 83 | cdecl, importcpp: "ShowsLabel", header: wxh.} 84 | type 85 | WxAnyButton* = WxAnyButtonBase 86 | -------------------------------------------------------------------------------- /wxnim/private/bannerwindow.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | discard "forward decl of wxBitmap" 4 | discard "forward decl of wxColour" 5 | discard "forward decl of wxDC" 6 | type 7 | WxBannerWindow* {.importcpp: "wxBannerWindow", header: wxh.} = object of WxWindow 8 | 9 | 10 | proc constructwxBannerWindow*(): WxBannerWindow {.cdecl, constructor, 11 | importcpp: "wxBannerWindow(@)", header: wxh.} 12 | proc constructwxBannerWindow*(parent: ptr WxWindow; dir: WxDirection = wxLEFT): WxBannerWindow {. 13 | cdecl, constructor, importcpp: "wxBannerWindow(@)", header: wxh.} 14 | proc constructwxBannerWindow*(parent: ptr WxWindow; winid: WxWindowID; 15 | dir: WxDirection = wxLEFT; 16 | pos: WxPoint = wxDefaultPosition; 17 | size: WxSize = wxDefaultSize; style: clong = 0; 18 | name: WxString = constructWxString("bannerwindow")): WxBannerWindow {.cdecl, 19 | constructor, importcpp: "wxBannerWindow(@)", header: wxh.} 20 | proc create*(this: var WxBannerWindow; parent: ptr WxWindow; winid: WxWindowID; 21 | dir: WxDirection = wxLEFT; pos: WxPoint = wxDefaultPosition; 22 | size: WxSize = wxDefaultSize; style: clong = 0; 23 | name: WxString = constructWxString("bannerwindow")): bool {.cdecl, 24 | importcpp: "Create", header: wxh.} 25 | proc setBitmap*(this: var WxBannerWindow; bmp: WxBitmap) {.cdecl, 26 | importcpp: "SetBitmap", header: wxh.} 27 | proc setText*(this: var WxBannerWindow; title: WxString; message: WxString) {. 28 | cdecl, importcpp: "SetText", header: wxh.} 29 | proc setGradient*(this: var WxBannerWindow; start: WxColour; `end`: WxColour) {. 30 | cdecl, importcpp: "SetGradient", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/bmpbuttn.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxHAS_BUTTON_BITMAP* = true 6 | 7 | type 8 | WxBitmapButton* {.importcpp: "wxBitmapButton", header: wxh.} = object 9 | 10 | 11 | 12 | type 13 | WxBitmapButtonBase* {.importcpp: "wxBitmapButtonBase", header: wxh.} = object of WxButton 14 | 15 | 16 | proc constructwxBitmapButtonBase*(): WxBitmapButtonBase {.cdecl, constructor, 17 | importcpp: "wxBitmapButtonBase(@)", header: wxh.} 18 | proc create*(this: var WxBitmapButtonBase; parent: ptr WxWindow; 19 | winid: WxWindowID; pos: WxPoint; size: WxSize; style: clong; 20 | validator: WxValidator; name: WxString): bool {.cdecl, 21 | importcpp: "Create", header: wxh.} 22 | proc newCloseButton*(parent: ptr WxWindow; winid: WxWindowID): ptr WxBitmapButton {. 23 | cdecl, importcpp: "wxBitmapButtonBase::NewCloseButton(@)", header: wxh.} 24 | proc setMargins*(this: var WxBitmapButtonBase; x: cint; y: cint) {.cdecl, 25 | importcpp: "SetMargins", header: wxh.} 26 | proc getMarginX*(this: WxBitmapButtonBase): cint {.noSideEffect, cdecl, 27 | importcpp: "GetMarginX", header: wxh.} 28 | proc getMarginY*(this: WxBitmapButtonBase): cint {.noSideEffect, cdecl, 29 | importcpp: "GetMarginY", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/button.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxButtonBase* {.importcpp: "wxButtonBase", header: wxh.} = object of WxAnyButton 6 | 7 | 8 | proc constructwxButtonBase*(): WxButtonBase {.cdecl, constructor, 9 | importcpp: "wxButtonBase(@)", header: wxh.} 10 | proc setAuthNeeded*(this: var WxButtonBase; show: bool = true) {.cdecl, 11 | importcpp: "SetAuthNeeded", header: wxh.} 12 | proc getAuthNeeded*(this: WxButtonBase): bool {.noSideEffect, cdecl, 13 | importcpp: "GetAuthNeeded", header: wxh.} 14 | proc setDefault*(this: var WxButtonBase): ptr WxWindow {.discardable, cdecl, 15 | importcpp: "SetDefault", header: wxh.} 16 | proc getDefaultSize*(): WxSize {.cdecl, 17 | importcpp: "wxButtonBase::GetDefaultSize(@)", 18 | header: wxh.} 19 | type 20 | WxButton* {.importcpp: "wxButton", header: wxh.} = object of WxButtonBase 21 | 22 | 23 | proc constructwxButton*(): WxButton {.cdecl, constructor, 24 | importcpp: "wxButton(@)", header: wxh.} 25 | proc constructwxButton*(parent: ptr WxWindow; id: WxWindowID; 26 | label: WxString = wxEmptyString; 27 | pos: WxPoint = wxDefaultPosition; 28 | size: WxSize = wxDefaultSize; style: clong = 0; 29 | validator: WxValidator = wxDefaultValidator; 30 | name: WxString = constructWxString("button")): WxButton {. 31 | cdecl, constructor, importcpp: "wxButton(@)", header: wxh.} 32 | proc create*(this: var WxButton; parent: ptr WxWindow; id: WxWindowID; 33 | label: WxString = wxEmptyString; pos: WxPoint = wxDefaultPosition; 34 | size: WxSize = wxDefaultSize; style: clong = 0; 35 | validator: WxValidator = wxDefaultValidator; 36 | name: WxString = constructWxString("button")): bool {.cdecl, 37 | importcpp: "Create", header: wxh.} 38 | proc destroywxButton*(this: var WxButton) {.cdecl, importcpp: "#.~wxButton()", 39 | header: wxh.} 40 | proc setDefault*(this: var WxButton): ptr WxWindow {.discardable, cdecl, 41 | importcpp: "SetDefault", header: wxh.} 42 | proc command*(this: var WxButton; event: var WxCommandEvent) {.cdecl, 43 | importcpp: "Command", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/checkbox.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxCHK_2STATE* = 0x00004000 6 | wxCHK_3STATE* = 0x00001000 7 | 8 | 9 | const 10 | wxCHK_ALLOW_3RD_STATE_FOR_USER* = 0x00002000 11 | 12 | 13 | type 14 | WxCheckBoxBase* {.importcpp: "wxCheckBoxBase", header: wxh.} = object of WxControl 15 | 16 | 17 | proc constructwxCheckBoxBase*(): WxCheckBoxBase {.cdecl, constructor, 18 | importcpp: "wxCheckBoxBase(@)", header: wxh.} 19 | proc setValue*(this: var WxCheckBoxBase; value: bool) {.cdecl, 20 | importcpp: "SetValue", header: wxh.} 21 | proc getValue*(this: WxCheckBoxBase): bool {.noSideEffect, cdecl, 22 | importcpp: "GetValue", header: wxh.} 23 | proc isChecked*(this: WxCheckBoxBase): bool {.noSideEffect, cdecl, 24 | importcpp: "IsChecked", header: wxh.} 25 | proc get3StateValue*(this: WxCheckBoxBase): WxCheckBoxState {.noSideEffect, 26 | cdecl, importcpp: "Get3StateValue", header: wxh.} 27 | proc set3StateValue*(this: var WxCheckBoxBase; state: WxCheckBoxState) {.cdecl, 28 | importcpp: "Set3StateValue", header: wxh.} 29 | proc is3State*(this: WxCheckBoxBase): bool {.noSideEffect, cdecl, 30 | importcpp: "Is3State", header: wxh.} 31 | proc is3rdStateAllowedForUser*(this: WxCheckBoxBase): bool {.noSideEffect, 32 | cdecl, importcpp: "Is3rdStateAllowedForUser", header: wxh.} 33 | proc hasTransparentBackground*(this: var WxCheckBoxBase): bool {.cdecl, 34 | importcpp: "HasTransparentBackground", header: wxh.} 35 | proc doUpdateWindowUI*(this: var WxCheckBoxBase; event: var WxUpdateUIEvent) {. 36 | cdecl, importcpp: "DoUpdateWindowUI", header: wxh.} 37 | type 38 | WxCheckBox* {.importcpp: "wxCheckBox", header: wxh.} = object of WxCheckBoxBase 39 | 40 | 41 | proc constructwxCheckBox*(): WxCheckBox {.cdecl, constructor, 42 | importcpp: "wxCheckBox(@)", header: wxh.} 43 | proc constructwxCheckBox*(parent: ptr WxWindow; id: WxWindowID; label: WxString; 44 | pos: WxPoint = wxDefaultPosition; 45 | size: WxSize = wxDefaultSize; style: clong = 0; 46 | validator: WxValidator = wxDefaultValidator; 47 | name: WxString = constructWxString("checkbox")): WxCheckBox {. 48 | cdecl, constructor, importcpp: "wxCheckBox(@)", header: wxh.} 49 | proc create*(this: var WxCheckBox; parent: ptr WxWindow; id: WxWindowID; 50 | label: WxString; pos: WxPoint = wxDefaultPosition; 51 | size: WxSize = wxDefaultSize; style: clong = 0; 52 | validator: WxValidator = wxDefaultValidator; 53 | name: WxString = constructWxString("checkbox")): bool {.cdecl, 54 | importcpp: "Create", header: wxh.} 55 | proc setValue*(this: var WxCheckBox; value: bool) {.cdecl, 56 | importcpp: "SetValue", header: wxh.} 57 | proc getValue*(this: WxCheckBox): bool {.noSideEffect, cdecl, 58 | importcpp: "GetValue", header: wxh.} 59 | proc setLabel*(this: var WxCheckBox; label: WxString) {.cdecl, 60 | importcpp: "SetLabel", header: wxh.} 61 | proc command*(this: var WxCheckBox; event: var WxCommandEvent) {.cdecl, 62 | importcpp: "Command", header: wxh.} 63 | proc setForegroundColour*(this: var WxCheckBox; colour: WxColour): bool {. 64 | discardable, cdecl, importcpp: "SetForegroundColour", header: wxh.} 65 | proc canApplyThemeBorder*(this: WxCheckBox): bool {.noSideEffect, cdecl, 66 | importcpp: "CanApplyThemeBorder", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/checklst.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxCheckListBoxBase* {.importcpp: "wxCheckListBoxBase", header: wxh.} = object of WxListBox 6 | 7 | 8 | proc constructwxCheckListBoxBase*(): WxCheckListBoxBase {.cdecl, constructor, 9 | importcpp: "wxCheckListBoxBase(@)", header: wxh.} 10 | proc isChecked*(this: WxCheckListBoxBase; item: cuint): bool {.noSideEffect, 11 | cdecl, importcpp: "IsChecked", header: wxh.} 12 | proc check*(this: var WxCheckListBoxBase; item: cuint; check: bool = true) {. 13 | cdecl, importcpp: "Check", header: wxh.} 14 | proc getCheckedItems*(this: WxCheckListBoxBase; checkedItems: var WxArrayInt): cuint {. 15 | noSideEffect, cdecl, importcpp: "GetCheckedItems", header: wxh.} 16 | -------------------------------------------------------------------------------- /wxnim/private/choice.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | type 6 | WxChoiceBase* {.importcpp: "wxChoiceBase", header: wxh.} = object of WxControlWithItems 7 | 8 | 9 | proc constructwxChoiceBase*(): WxChoiceBase {.cdecl, constructor, 10 | importcpp: "wxChoiceBase(@)", header: wxh.} 11 | proc destroywxChoiceBase*(this: var WxChoiceBase) {.cdecl, 12 | importcpp: "#.~wxChoiceBase()", header: wxh.} 13 | proc getCurrentSelection*(this: WxChoiceBase): cint {.noSideEffect, cdecl, 14 | importcpp: "GetCurrentSelection", header: wxh.} 15 | proc setColumns*(this: var WxChoiceBase; n: cint = 1) {.cdecl, 16 | importcpp: "SetColumns", header: wxh.} 17 | proc getColumns*(this: WxChoiceBase): cint {.noSideEffect, cdecl, 18 | importcpp: "GetColumns", header: wxh.} 19 | proc command*(this: var WxChoiceBase; event: var WxCommandEvent) {.cdecl, 20 | importcpp: "Command", header: wxh.} 21 | proc isSorted*(this: WxChoiceBase): bool {.noSideEffect, cdecl, 22 | importcpp: "IsSorted", header: wxh.} 23 | type 24 | WxChoice* {.importcpp: "wxChoice", header: wxh.} = object of WxChoiceBase 25 | 26 | 27 | proc constructwxChoice*(): WxChoice {.cdecl, constructor, 28 | importcpp: "wxChoice(@)", header: wxh.} 29 | proc destroywxChoice*(this: var WxChoice) {.cdecl, importcpp: "#.~wxChoice()", 30 | header: wxh.} 31 | proc constructwxChoice*(parent: ptr WxWindow; id: WxWindowID; 32 | pos: WxPoint = wxDefaultPosition; 33 | size: WxSize = wxDefaultSize; n: cint = 0; 34 | choices: ptr WxString = nil; style: clong = 0; 35 | validator: WxValidator = wxDefaultValidator; 36 | name: WxString = constructWxString("choice")): WxChoice {. 37 | cdecl, constructor, importcpp: "wxChoice(@)", header: wxh.} 38 | proc constructwxChoice*(parent: ptr WxWindow; id: WxWindowID; pos: WxPoint; 39 | size: WxSize; choices: WxArrayString; style: clong = 0; 40 | validator: WxValidator = wxDefaultValidator; 41 | name: WxString = constructWxString("choice")): WxChoice {. 42 | cdecl, constructor, importcpp: "wxChoice(@)", header: wxh.} 43 | proc create*(this: var WxChoice; parent: ptr WxWindow; id: WxWindowID; 44 | pos: WxPoint = wxDefaultPosition; size: WxSize = wxDefaultSize; 45 | n: cint = 0; choices: ptr WxString = nil; style: clong = 0; 46 | validator: WxValidator = wxDefaultValidator; 47 | name: WxString = constructWxString("choice")): bool {.cdecl, 48 | importcpp: "Create", header: wxh.} 49 | proc create*(this: var WxChoice; parent: ptr WxWindow; id: WxWindowID; 50 | pos: WxPoint; size: WxSize; choices: WxArrayString; 51 | style: clong = 0; validator: WxValidator = wxDefaultValidator; 52 | name: WxString = constructWxString("choice")): bool {.cdecl, 53 | importcpp: "Create", header: wxh.} 54 | proc show*(this: var WxChoice; show: bool = true): bool {.discardable, cdecl, 55 | importcpp: "Show", header: wxh.} 56 | proc setLabel*(this: var WxChoice; label: WxString) {.cdecl, 57 | importcpp: "SetLabel", header: wxh.} 58 | proc getCount*(this: WxChoice): cuint {.noSideEffect, cdecl, 59 | importcpp: "GetCount", header: wxh.} 60 | proc getSelection*(this: WxChoice): cint {.noSideEffect, cdecl, 61 | importcpp: "GetSelection", header: wxh.} 62 | proc getCurrentSelection*(this: WxChoice): cint {.noSideEffect, cdecl, 63 | importcpp: "GetCurrentSelection", header: wxh.} 64 | proc setSelection*(this: var WxChoice; n: cint) {.cdecl, 65 | importcpp: "SetSelection", header: wxh.} 66 | proc findString*(this: WxChoice; s: WxString; bCase: bool = false): cint {. 67 | noSideEffect, cdecl, importcpp: "FindString", header: wxh.} 68 | proc getString*(this: WxChoice; n: cuint): WxString {.noSideEffect, cdecl, 69 | importcpp: "GetString", header: wxh.} 70 | proc setString*(this: var WxChoice; n: cuint; s: WxString) {.cdecl, 71 | importcpp: "SetString", header: wxh.} 72 | proc getDefaultAttributes*(this: WxChoice): WxVisualAttributes {.noSideEffect, 73 | cdecl, importcpp: "GetDefaultAttributes", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/colordlg.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxColourData* {.importcpp: "wxColourData", header: wxh.} = object 5 | 6 | 7 | 8 | proc wxGetColourFromUser*(parent: ptr WxWindow = nil; 9 | colInit: WxColour = wxNullColour; 10 | caption: WxString = wxEmptyString; 11 | data: ptr WxColourData = nil): WxColour {.cdecl, 12 | importcpp: "wxGetColourFromUser(@)", header: wxh.} 13 | -------------------------------------------------------------------------------- /wxnim/private/commandlinkbutton.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxCommandLinkButtonBase* {.importcpp: "wxCommandLinkButtonBase", header: wxh.} = object of WxButton 6 | 7 | 8 | proc constructwxCommandLinkButtonBase*(): WxCommandLinkButtonBase {.cdecl, 9 | constructor, importcpp: "wxCommandLinkButtonBase(@)", header: wxh.} 10 | proc constructwxCommandLinkButtonBase*(parent: ptr WxWindow; id: WxWindowID; 11 | mainLabel: WxString = wxEmptyString; 12 | note: WxString = wxEmptyString; 13 | pos: WxPoint = wxDefaultPosition; 14 | size: WxSize = wxDefaultSize; 15 | style: clong = 0; validator: WxValidator = wxDefaultValidator; 16 | name: WxString = constructWxString("button")): WxCommandLinkButtonBase {. 17 | cdecl, constructor, importcpp: "wxCommandLinkButtonBase(@)", header: wxh.} 18 | proc setMainLabelAndNote*(this: var WxCommandLinkButtonBase; 19 | mainLabel: WxString; note: WxString) {.cdecl, 20 | importcpp: "SetMainLabelAndNote", header: wxh.} 21 | proc setMainLabel*(this: var WxCommandLinkButtonBase; mainLabel: WxString) {. 22 | cdecl, importcpp: "SetMainLabel", header: wxh.} 23 | proc setNote*(this: var WxCommandLinkButtonBase; note: WxString) {.cdecl, 24 | importcpp: "SetNote", header: wxh.} 25 | proc getMainLabel*(this: WxCommandLinkButtonBase): WxString {.noSideEffect, 26 | cdecl, importcpp: "GetMainLabel", header: wxh.} 27 | proc getNote*(this: WxCommandLinkButtonBase): WxString {.noSideEffect, cdecl, 28 | importcpp: "GetNote", header: wxh.} 29 | 30 | type 31 | WxGenericCommandLinkButton* {.importcpp: "wxGenericCommandLinkButton", 32 | header: wxh.} = object of WxCommandLinkButtonBase 33 | 34 | 35 | proc constructwxGenericCommandLinkButton*(): WxGenericCommandLinkButton {.cdecl, 36 | constructor, importcpp: "wxGenericCommandLinkButton(@)", header: wxh.} 37 | proc constructwxGenericCommandLinkButton*(parent: ptr WxWindow; id: WxWindowID; 38 | mainLabel: WxString = wxEmptyString; note: WxString = wxEmptyString; 39 | pos: WxPoint = wxDefaultPosition; size: WxSize = wxDefaultSize; 40 | style: clong = 0; validator: WxValidator = wxDefaultValidator; 41 | name: WxString = constructWxString("button")): WxGenericCommandLinkButton {. 42 | cdecl, constructor, importcpp: "wxGenericCommandLinkButton(@)", header: wxh.} 43 | proc create*(this: var WxGenericCommandLinkButton; parent: ptr WxWindow; 44 | id: WxWindowID; mainLabel: WxString = wxEmptyString; 45 | note: WxString = wxEmptyString; pos: WxPoint = wxDefaultPosition; 46 | size: WxSize = wxDefaultSize; style: clong = 0; 47 | validator: WxValidator = wxDefaultValidator; 48 | name: WxString = constructWxString("button")): bool {.cdecl, 49 | importcpp: "Create", header: wxh.} 50 | proc setMainLabelAndNote*(this: var WxGenericCommandLinkButton; 51 | mainLabel: WxString; note: WxString) {.cdecl, 52 | importcpp: "SetMainLabelAndNote", header: wxh.} 53 | type 54 | WxCommandLinkButton* {.importcpp: "wxCommandLinkButton", header: wxh.} = object of WxGenericCommandLinkButton 55 | 56 | 57 | proc constructwxCommandLinkButton*(): WxCommandLinkButton {.cdecl, constructor, 58 | importcpp: "wxCommandLinkButton(@)", header: wxh.} 59 | proc constructwxCommandLinkButton*(parent: ptr WxWindow; id: WxWindowID; 60 | mainLabel: WxString = wxEmptyString; 61 | note: WxString = wxEmptyString; 62 | pos: WxPoint = wxDefaultPosition; 63 | size: WxSize = wxDefaultSize; 64 | style: clong = 0; 65 | validator: WxValidator = wxDefaultValidator; 66 | name: WxString = constructWxString("button")): WxCommandLinkButton {. 67 | cdecl, constructor, importcpp: "wxCommandLinkButton(@)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/datectrl.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxDP_DEFAULT* = 0 6 | wxDP_SPIN* = 1 7 | wxDP_DROPDOWN* = 2 8 | wxDP_SHOWCENTURY* = 4 9 | wxDP_ALLOWNONE* = 8 10 | 11 | 12 | type 13 | WxDatePickerCtrlBase* {.importcpp: "wxDatePickerCtrlBase", header: wxh.} = object of WxDateTimePickerCtrl 14 | 15 | 16 | proc setRange*(this: var WxDatePickerCtrlBase; dt1: WxDateTime; dt2: WxDateTime) {. 17 | cdecl, importcpp: "SetRange", header: wxh.} 18 | proc getRange*(this: WxDatePickerCtrlBase; dt1: ptr WxDateTime; 19 | dt2: ptr WxDateTime): bool {.noSideEffect, cdecl, 20 | importcpp: "GetRange", header: wxh.} 21 | type 22 | WxDatePickerCtrl* {.importcpp: "wxDatePickerCtrl", header: wxh.} = object of WxDatePickerCtrlBase 23 | 24 | 25 | proc constructwxDatePickerCtrl*(): WxDatePickerCtrl {.cdecl, constructor, 26 | importcpp: "wxDatePickerCtrl(@)", header: wxh.} 27 | proc constructwxDatePickerCtrl*(parent: ptr WxWindow; id: WxWindowID; 28 | date: WxDateTime = wxDefaultDateTime; 29 | pos: WxPoint = wxDefaultPosition; 30 | size: WxSize = wxDefaultSize; style: clong = wxDP_DEFAULT or 31 | wxDP_SHOWCENTURY; validator: WxValidator = wxDefaultValidator; 32 | name: WxString = constructWxString("datectrl")): WxDatePickerCtrl {. 33 | cdecl, constructor, importcpp: "wxDatePickerCtrl(@)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/datetimectrl.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | const 4 | wxNEEDS_DATETIMEPICKCTRL* = true 5 | 6 | 7 | type 8 | WxDateTimePickerCtrlBase* {.importcpp: "wxDateTimePickerCtrlBase", header: wxh.} = object of WxControl 9 | 10 | 11 | proc setValue*(this: var WxDateTimePickerCtrlBase; dt: WxDateTime) {.cdecl, 12 | importcpp: "SetValue", header: wxh.} 13 | proc getValue*(this: WxDateTimePickerCtrlBase): WxDateTime {.noSideEffect, 14 | cdecl, importcpp: "GetValue", header: wxh.} 15 | type 16 | WxDateTimePickerCtrl* = WxDateTimePickerCtrlBase 17 | -------------------------------------------------------------------------------- /wxnim/private/dialog.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | var wxDEFAULT_DIALOG_STYLE* {.importcpp: "wxDEFAULT_DIALOG_STYLE", header: wxh.}: clong 4 | 5 | 6 | type 7 | WxDialog* {.importcpp: "wxDialog", header: wxh.} = object of WxWindow 8 | 9 | 10 | proc constructwxDialog*(): WxDialog {.cdecl, constructor, 11 | importcpp: "wxDialog(@)", header: wxh.} 12 | proc constructwxDialog*(parent: ptr WxWindow; id: WxWindowID; title: WxString; 13 | pos: WxPoint = wxDefaultPosition; 14 | size: WxSize = wxDefaultSize; 15 | style: clong = wxDEFAULT_DIALOG_STYLE; 16 | name: WxString = constructWxString("dialog")): WxDialog {. 17 | cdecl, constructor, importcpp: "wxDialog(@)", header: wxh.} 18 | proc create*(this: var WxDialog; parent: ptr WxWindow; id: WxWindowID; 19 | title: WxString; pos: WxPoint = wxDefaultPosition; 20 | size: WxSize = wxDefaultSize; 21 | style: clong = wxDEFAULT_DIALOG_STYLE; 22 | name: WxString = constructWxString("dialog")): bool {.cdecl, 23 | importcpp: "Create", header: wxh.} 24 | proc destroywxDialog*(this: var WxDialog) {.cdecl, importcpp: "#.~wxDialog()", 25 | header: wxh.} 26 | proc isModal*(this: WxDialog): bool {.noSideEffect, cdecl, importcpp: "IsModal", 27 | header: wxh.} 28 | proc showModal*(this: var WxDialog): cint {.discardable, cdecl, 29 | importcpp: "ShowModal", header: wxh.} 30 | proc endModal*(this: var WxDialog; retCode: cint) {.cdecl, 31 | importcpp: "EndModal", header: wxh.} 32 | proc isModalShowing*(this: WxDialog): bool {.noSideEffect, cdecl, 33 | importcpp: "IsModalShowing", header: wxh.} 34 | proc show*(this: var WxDialog; show: bool = true): bool {.discardable, cdecl, 35 | importcpp: "Show", header: wxh.} 36 | proc onCloseWindow*(this: var WxDialog; event: var WxCloseEvent) {.cdecl, 37 | importcpp: "OnCloseWindow", header: wxh.} 38 | proc onOK*(this: var WxDialog; event: var WxCommandEvent) {.cdecl, 39 | importcpp: "OnOK", header: wxh.} 40 | proc onApply*(this: var WxDialog; event: var WxCommandEvent) {.cdecl, 41 | importcpp: "OnApply", header: wxh.} 42 | proc onCancel*(this: var WxDialog; event: var WxCommandEvent) {.cdecl, 43 | importcpp: "OnCancel", header: wxh.} 44 | -------------------------------------------------------------------------------- /wxnim/private/dirdlg.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxDD_CHANGE_DIR* = 0x00000100 6 | wxDD_DIR_MUST_EXIST* = 0x00000200 7 | 8 | 9 | const 10 | wxDD_NEW_DIR_BUTTON* = 0 11 | 12 | var wxDD_DEFAULT_STYLE* {.importcpp: "wxDD_DEFAULT_STYLE", header: wxh.}: clong 13 | 14 | 15 | type 16 | WxDirDialogBase* {.importcpp: "wxDirDialogBase", header: wxh.} = object of WxDialog 17 | 18 | 19 | proc constructwxDirDialogBase*(): WxDirDialogBase {.cdecl, constructor, 20 | importcpp: "wxDirDialogBase(@)", header: wxh.} 21 | proc constructwxDirDialogBase*(parent: ptr WxWindow; title: WxString = constructWxString( 22 | "Select a directory"); defaultPath: WxString = wxEmptyString; 23 | style: clong = wxDD_DEFAULT_STYLE; 24 | pos: WxPoint = wxDefaultPosition; 25 | sz: WxSize = wxDefaultSize; 26 | name: WxString = constructWxString("wxDirCtrl")): WxDirDialogBase {. 27 | cdecl, constructor, importcpp: "wxDirDialogBase(@)", header: wxh.} 28 | proc destroywxDirDialogBase*(this: var WxDirDialogBase) {.cdecl, 29 | importcpp: "#.~wxDirDialogBase()", header: wxh.} 30 | proc create*(this: var WxDirDialogBase; parent: ptr WxWindow; 31 | title: WxString = constructWxString("Select a directory"); 32 | defaultPath: WxString = wxEmptyString; 33 | style: clong = wxDD_DEFAULT_STYLE; 34 | pos: WxPoint = wxDefaultPosition; sz: WxSize = wxDefaultSize; 35 | name: WxString = constructWxString("wxDirCtrl")): bool {.cdecl, 36 | importcpp: "Create", header: wxh.} 37 | proc setMessage*(this: var WxDirDialogBase; message: WxString) {.cdecl, 38 | importcpp: "SetMessage", header: wxh.} 39 | proc setPath*(this: var WxDirDialogBase; path: WxString) {.cdecl, 40 | importcpp: "SetPath", header: wxh.} 41 | proc getMessage*(this: WxDirDialogBase): WxString {.noSideEffect, cdecl, 42 | importcpp: "GetMessage", header: wxh.} 43 | proc getPath*(this: WxDirDialogBase): WxString {.noSideEffect, cdecl, 44 | importcpp: "GetPath", header: wxh.} 45 | 46 | proc wxDirSelector*(message: WxString = constructWxString("Select a directory"); 47 | defaultPath: WxString = wxEmptyString; 48 | style: clong = wxDD_DEFAULT_STYLE; 49 | pos: WxPoint = wxDefaultPosition; parent: ptr WxWindow = nil): WxString {. 50 | cdecl, importcpp: "wxDirSelector(@)", header: wxh.} 51 | -------------------------------------------------------------------------------- /wxnim/private/fontdata.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxFontData* {.importcpp: "wxFontData", header: wxh.} = object of WxObject 5 | mFontColour* {.importc: "m_fontColour".}: WxColour 6 | mShowHelp* {.importc: "m_showHelp".}: bool 7 | mAllowSymbols* {.importc: "m_allowSymbols".}: bool 8 | mEnableEffects* {.importc: "m_enableEffects".}: bool 9 | mInitialFont* {.importc: "m_initialFont".}: WxFont 10 | mChosenFont* {.importc: "m_chosenFont".}: WxFont 11 | mMinSize* {.importc: "m_minSize".}: cint 12 | mMaxSize* {.importc: "m_maxSize".}: cint 13 | 14 | 15 | proc constructwxFontData*(): WxFontData {.cdecl, constructor, 16 | importcpp: "wxFontData(@)", header: wxh.} 17 | proc destroywxFontData*(this: var WxFontData) {.cdecl, 18 | importcpp: "#.~wxFontData()", header: wxh.} 19 | proc constructwxFontData*(data: WxFontData): WxFontData {.cdecl, constructor, 20 | importcpp: "wxFontData(@)", header: wxh.} 21 | proc setAllowSymbols*(this: var WxFontData; flag: bool) {.cdecl, 22 | importcpp: "SetAllowSymbols", header: wxh.} 23 | proc getAllowSymbols*(this: WxFontData): bool {.noSideEffect, cdecl, 24 | importcpp: "GetAllowSymbols", header: wxh.} 25 | proc setColour*(this: var WxFontData; colour: WxColour) {.cdecl, 26 | importcpp: "SetColour", header: wxh.} 27 | proc getColour*(this: WxFontData): WxColour {.noSideEffect, cdecl, 28 | importcpp: "GetColour", header: wxh.} 29 | proc setShowHelp*(this: var WxFontData; flag: bool) {.cdecl, 30 | importcpp: "SetShowHelp", header: wxh.} 31 | proc getShowHelp*(this: WxFontData): bool {.noSideEffect, cdecl, 32 | importcpp: "GetShowHelp", header: wxh.} 33 | proc enableEffects*(this: var WxFontData; flag: bool) {.cdecl, 34 | importcpp: "EnableEffects", header: wxh.} 35 | proc getEnableEffects*(this: WxFontData): bool {.noSideEffect, cdecl, 36 | importcpp: "GetEnableEffects", header: wxh.} 37 | proc setInitialFont*(this: var WxFontData; font: WxFont) {.cdecl, 38 | importcpp: "SetInitialFont", header: wxh.} 39 | proc getInitialFont*(this: WxFontData): WxFont {.noSideEffect, cdecl, 40 | importcpp: "GetInitialFont", header: wxh.} 41 | proc setChosenFont*(this: var WxFontData; font: WxFont) {.cdecl, 42 | importcpp: "SetChosenFont", header: wxh.} 43 | proc getChosenFont*(this: WxFontData): WxFont {.noSideEffect, cdecl, 44 | importcpp: "GetChosenFont", header: wxh.} 45 | proc setRange*(this: var WxFontData; minRange: cint; maxRange: cint) {.cdecl, 46 | importcpp: "SetRange", header: wxh.} 47 | proc getEncoding*(this: WxFontData): WxFontEncoding {.noSideEffect, cdecl, 48 | importcpp: "GetEncoding", header: wxh.} 49 | proc setEncoding*(this: var WxFontData; encoding: WxFontEncoding) {.cdecl, 50 | importcpp: "SetEncoding", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/fontdlg.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxFontDialogBase* {.importcpp: "wxFontDialogBase", header: wxh.} = object of WxDialog 6 | 7 | 8 | proc constructwxFontDialogBase*(): WxFontDialogBase {.cdecl, constructor, 9 | importcpp: "wxFontDialogBase(@)", header: wxh.} 10 | proc constructwxFontDialogBase*(parent: ptr WxWindow): WxFontDialogBase {.cdecl, 11 | constructor, importcpp: "wxFontDialogBase(@)", header: wxh.} 12 | proc constructwxFontDialogBase*(parent: ptr WxWindow; data: WxFontData): WxFontDialogBase {. 13 | cdecl, constructor, importcpp: "wxFontDialogBase(@)", header: wxh.} 14 | proc create*(this: var WxFontDialogBase; parent: ptr WxWindow): bool {.cdecl, 15 | importcpp: "Create", header: wxh.} 16 | proc create*(this: var WxFontDialogBase; parent: ptr WxWindow; data: WxFontData): bool {. 17 | cdecl, importcpp: "Create", header: wxh.} 18 | proc getFontData*(this: WxFontDialogBase): WxFontData {.noSideEffect, cdecl, 19 | importcpp: "GetFontData", header: wxh.} 20 | proc getFontData*(this: var WxFontDialogBase): var WxFontData {.cdecl, 21 | importcpp: "GetFontData", header: wxh.} 22 | 23 | proc wxGetFontFromUser*(parent: ptr WxWindow = nil; 24 | fontInit: WxFont = wxNullFont; 25 | caption: WxString = wxEmptyString): WxFont {.cdecl, 26 | importcpp: "wxGetFontFromUser(@)", header: wxh.} 27 | -------------------------------------------------------------------------------- /wxnim/private/fontenc.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxFontEncoding* {.size: sizeof(cint), importcpp: "wxFontEncoding", header: wxh.} = enum 6 | wxFONTENCODING_SYSTEM = - 1, wxFONTENCODING_DEFAULT, 7 | wxFONTENCODING_ISO88591, wxFONTENCODING_ISO88592, wxFONTENCODING_ISO88593, 8 | wxFONTENCODING_ISO88594, wxFONTENCODING_ISO88595, wxFONTENCODING_ISO88596, 9 | wxFONTENCODING_ISO88597, wxFONTENCODING_ISO88598, wxFONTENCODING_ISO88599, 10 | wxFONTENCODING_ISO885910, wxFONTENCODING_ISO885911, 11 | wxFONTENCODING_ISO885912, wxFONTENCODING_ISO885913, 12 | wxFONTENCODING_ISO885914, wxFONTENCODING_ISO885915, 13 | wxFONTENCODING_ISO8859MAX, wxFONTENCODING_KOI8, wxFONTENCODING_KOI8U, 14 | wxFONTENCODING_ALTERNATIVE, wxFONTENCODING_BULGARIAN, wxFONTENCODING_CP437, 15 | wxFONTENCODING_CP850, wxFONTENCODING_CP852, wxFONTENCODING_CP855, 16 | wxFONTENCODING_CP866, wxFONTENCODING_CP874, wxFONTENCODING_CP932, 17 | wxFONTENCODING_CP936, wxFONTENCODING_CP949, wxFONTENCODING_CP950, 18 | wxFONTENCODING_CP1250, wxFONTENCODING_CP1251, wxFONTENCODING_CP1252, 19 | wxFONTENCODING_CP1253, wxFONTENCODING_CP1254, wxFONTENCODING_CP1255, 20 | wxFONTENCODING_CP1256, wxFONTENCODING_CP1257, wxFONTENCODING_CP1258, 21 | wxFONTENCODING_CP1361, wxFONTENCODING_CP12MAX, wxFONTENCODING_UTF7, 22 | wxFONTENCODING_UTF8, wxFONTENCODING_EUC_JP, wxFONTENCODING_UTF16BE, 23 | wxFONTENCODING_UTF16LE, wxFONTENCODING_UTF32BE, wxFONTENCODING_UTF32LE, 24 | wxFONTENCODING_MACROMAN, wxFONTENCODING_MACJAPANESE, 25 | wxFONTENCODING_MACCHINESETRAD, wxFONTENCODING_MACKOREAN, 26 | wxFONTENCODING_MACARABIC, wxFONTENCODING_MACHEBREW, wxFONTENCODING_MACGREEK, 27 | wxFONTENCODING_MACCYRILLIC, wxFONTENCODING_MACDEVANAGARI, 28 | wxFONTENCODING_MACGURMUKHI, wxFONTENCODING_MACGUJARATI, 29 | wxFONTENCODING_MACORIYA, wxFONTENCODING_MACBENGALI, wxFONTENCODING_MACTAMIL, 30 | wxFONTENCODING_MACTELUGU, wxFONTENCODING_MACKANNADA, 31 | wxFONTENCODING_MACMALAJALAM, wxFONTENCODING_MACSINHALESE, 32 | wxFONTENCODING_MACBURMESE, wxFONTENCODING_MACKHMER, wxFONTENCODING_MACTHAI, 33 | wxFONTENCODING_MACLAOTIAN, wxFONTENCODING_MACGEORGIAN, 34 | wxFONTENCODING_MACARMENIAN, wxFONTENCODING_MACCHINESESIMP, 35 | wxFONTENCODING_MACTIBETAN, wxFONTENCODING_MACMONGOLIAN, 36 | wxFONTENCODING_MACETHIOPIC, wxFONTENCODING_MACCENTRALEUR, 37 | wxFONTENCODING_MACVIATNAMESE, wxFONTENCODING_MACARABICEXT, 38 | wxFONTENCODING_MACSYMBOL, wxFONTENCODING_MACDINGBATS, 39 | wxFONTENCODING_MACTURKISH, wxFONTENCODING_MACCROATIAN, 40 | wxFONTENCODING_MACICELANDIC, wxFONTENCODING_MACROMANIAN, 41 | wxFONTENCODING_MACCELTIC, wxFONTENCODING_MACGAELIC, 42 | wxFONTENCODING_MACKEYBOARD, wxFONTENCODING_ISO2022JP, wxFONTENCODING_MAX 43 | 44 | const 45 | wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN 46 | wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD 47 | wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16LE 48 | wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32LE 49 | wxFONTENCODING_UNICODE = wxFONTENCODING_UTF32 50 | wxFONTENCODING_GB2312 = wxFONTENCODING_CP936 51 | wxFONTENCODING_BIG5 = wxFONTENCODING_CP950 52 | wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932 53 | wxFONTENCODING_EUC_KR = wxFONTENCODING_CP949 54 | wxFONTENCODING_JOHAB = wxFONTENCODING_CP1361 55 | wxFONTENCODING_VIETNAMESE = wxFONTENCODING_CP1258 56 | -------------------------------------------------------------------------------- /wxnim/private/fontenum.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxFontEnumerator* {.importcpp: "wxFontEnumerator", header: wxh.} = object 6 | 7 | 8 | proc constructwxFontEnumerator*(): WxFontEnumerator {.cdecl, constructor, 9 | importcpp: "wxFontEnumerator(@)", header: wxh.} 10 | proc destroywxFontEnumerator*(this: var WxFontEnumerator) {.cdecl, 11 | importcpp: "#.~wxFontEnumerator()", header: wxh.} 12 | proc enumerateFacenames*(this: var WxFontEnumerator; 13 | encoding: WxFontEncoding = wxFONTENCODING_SYSTEM; 14 | fixedWidthOnly: bool = false): bool {.cdecl, 15 | importcpp: "EnumerateFacenames", header: wxh.} 16 | proc enumerateEncodings*(this: var WxFontEnumerator; 17 | facename: WxString = wxEmptyString): bool {.cdecl, 18 | importcpp: "EnumerateEncodings", header: wxh.} 19 | proc onFacename*(this: var WxFontEnumerator; facename: WxString): bool {.cdecl, 20 | importcpp: "OnFacename", header: wxh.} 21 | proc onFontEncoding*(this: var WxFontEnumerator; facename: WxString; 22 | encoding: WxString): bool {.cdecl, 23 | importcpp: "OnFontEncoding", header: wxh.} 24 | proc getFacenames*(encoding: WxFontEncoding = wxFONTENCODING_SYSTEM; 25 | fixedWidthOnly: bool = false): WxArrayString {.cdecl, 26 | importcpp: "wxFontEnumerator::GetFacenames(@)", header: wxh.} 27 | proc getEncodings*(facename: WxString = wxEmptyString): WxArrayString {.cdecl, 28 | importcpp: "wxFontEnumerator::GetEncodings(@)", header: wxh.} 29 | proc isValidFacename*(str: WxString): bool {.cdecl, 30 | importcpp: "wxFontEnumerator::IsValidFacename(@)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/gauge.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | const 4 | wxGA_HORIZONTAL* = wxHORIZONTAL 5 | wxGA_VERTICAL* = wxVERTICAL 6 | 7 | 8 | const 9 | wxGA_SMOOTH* = 0x00000020 10 | 11 | 12 | type 13 | WxGauge* {.importcpp: "wxGauge", header: wxh.} = object of WxControl 14 | 15 | 16 | proc constructwxGauge*(): WxGauge {.cdecl, constructor, importcpp: "wxGauge(@)", 17 | header: wxh.} 18 | proc constructwxGauge*(parent: ptr WxWindow; id: WxWindowID; range: cint; 19 | pos: WxPoint = wxDefaultPosition; 20 | size: WxSize = wxDefaultSize; style: clong = wxGA_HORIZONTAL; 21 | validator: WxValidator = wxDefaultValidator; 22 | name: WxString = constructWxString("gauge")): WxGauge {.cdecl, 23 | constructor, importcpp: "wxGauge(@)", header: wxh.} 24 | proc destroywxGauge*(this: var WxGauge) {.cdecl, importcpp: "#.~wxGauge()", header: wxh.} 25 | proc create*(this: var WxGauge; parent: ptr WxWindow; id: WxWindowID; range: cint; 26 | pos: WxPoint = wxDefaultPosition; size: WxSize = wxDefaultSize; 27 | style: clong = wxGA_HORIZONTAL; 28 | validator: WxValidator = wxDefaultValidator; 29 | name: WxString = constructWxString("gauge")): bool {.cdecl, 30 | importcpp: "Create", header: wxh.} 31 | proc getBezelFace*(this: WxGauge): cint {.noSideEffect, cdecl, 32 | importcpp: "GetBezelFace", header: wxh.} 33 | proc getRange*(this: WxGauge): cint {.noSideEffect, cdecl, importcpp: "GetRange", 34 | header: wxh.} 35 | proc getShadowWidth*(this: WxGauge): cint {.noSideEffect, cdecl, 36 | importcpp: "GetShadowWidth", header: wxh.} 37 | proc getValue*(this: WxGauge): cint {.noSideEffect, cdecl, importcpp: "GetValue", 38 | header: wxh.} 39 | proc isVertical*(this: WxGauge): bool {.noSideEffect, cdecl, importcpp: "IsVertical", 40 | header: wxh.} 41 | proc pulse*(this: var WxGauge) {.cdecl, importcpp: "Pulse", header: wxh.} 42 | proc setBezelFace*(this: var WxGauge; width: cint) {.cdecl, importcpp: "SetBezelFace", 43 | header: wxh.} 44 | proc setRange*(this: var WxGauge; range: cint) {.cdecl, importcpp: "SetRange", 45 | header: wxh.} 46 | proc setShadowWidth*(this: var WxGauge; width: cint) {.cdecl, 47 | importcpp: "SetShadowWidth", header: wxh.} 48 | proc setValue*(this: var WxGauge; pos: cint) {.cdecl, importcpp: "SetValue", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/hyperlink.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxHL_CONTEXTMENU* = 0x00000001 6 | wxHL_ALIGN_LEFT* = 0x00000002 7 | wxHL_ALIGN_RIGHT* = 0x00000004 8 | wxHL_ALIGN_CENTER* = 0x00000008 9 | wxHL_DEFAULT_STYLE* = ( 10 | wxHL_CONTEXTMENU or int(wxNO_BORDER) or wxHL_ALIGN_CENTER) 11 | 12 | 13 | type 14 | WxHyperlinkCtrlBase* {.importcpp: "wxHyperlinkCtrlBase", header: wxh.} = object of WxControl 15 | 16 | 17 | proc getHoverColour*(this: WxHyperlinkCtrlBase): WxColour {.noSideEffect, cdecl, 18 | importcpp: "GetHoverColour", header: wxh.} 19 | proc setHoverColour*(this: var WxHyperlinkCtrlBase; colour: WxColour) {.cdecl, 20 | importcpp: "SetHoverColour", header: wxh.} 21 | proc getNormalColour*(this: WxHyperlinkCtrlBase): WxColour {.noSideEffect, 22 | cdecl, importcpp: "GetNormalColour", header: wxh.} 23 | proc setNormalColour*(this: var WxHyperlinkCtrlBase; colour: WxColour) {.cdecl, 24 | importcpp: "SetNormalColour", header: wxh.} 25 | proc getVisitedColour*(this: WxHyperlinkCtrlBase): WxColour {.noSideEffect, 26 | cdecl, importcpp: "GetVisitedColour", header: wxh.} 27 | proc setVisitedColour*(this: var WxHyperlinkCtrlBase; colour: WxColour) {.cdecl, 28 | importcpp: "SetVisitedColour", header: wxh.} 29 | proc getURL*(this: WxHyperlinkCtrlBase): WxString {.noSideEffect, cdecl, 30 | importcpp: "GetURL", header: wxh.} 31 | proc setURL*(this: var WxHyperlinkCtrlBase; url: WxString) {.cdecl, 32 | importcpp: "SetURL", header: wxh.} 33 | proc setVisited*(this: var WxHyperlinkCtrlBase; visited: bool = true) {.cdecl, 34 | importcpp: "SetVisited", header: wxh.} 35 | proc getVisited*(this: WxHyperlinkCtrlBase): bool {.noSideEffect, cdecl, 36 | importcpp: "GetVisited", header: wxh.} 37 | proc hasTransparentBackground*(this: var WxHyperlinkCtrlBase): bool {.cdecl, 38 | importcpp: "HasTransparentBackground", header: wxh.} 39 | proc sendEvent*(this: var WxHyperlinkCtrlBase) {.cdecl, importcpp: "SendEvent", 40 | header: wxh.} 41 | 42 | discard "forward decl of wxHyperlinkEvent" 43 | var wxEVT_HYPERLINK* {.importcpp: "wxEVT_HYPERLINK", header: wxh.}: WxEventTypeTag[ 44 | WxHyperlinkEvent] 45 | 46 | 47 | type 48 | WxHyperlinkEvent* {.importcpp: "wxHyperlinkEvent", header: wxh.} = object of WxCommandEvent 49 | 50 | 51 | proc constructwxHyperlinkEvent*(): WxHyperlinkEvent {.cdecl, constructor, 52 | importcpp: "wxHyperlinkEvent(@)", header: wxh.} 53 | proc constructwxHyperlinkEvent*(generator: ptr WxObject; id: WxWindowID; 54 | url: WxString): WxHyperlinkEvent {.cdecl, 55 | constructor, importcpp: "wxHyperlinkEvent(@)", header: wxh.} 56 | proc getURL*(this: WxHyperlinkEvent): WxString {.noSideEffect, cdecl, 57 | importcpp: "GetURL", header: wxh.} 58 | proc setURL*(this: var WxHyperlinkEvent; url: WxString) {.cdecl, 59 | importcpp: "SetURL", header: wxh.} 60 | proc clone*(this: WxHyperlinkEvent): ptr WxEvent {.noSideEffect, cdecl, 61 | importcpp: "Clone", header: wxh.} 62 | 63 | type 64 | WxHyperlinkCtrl* {.importcpp: "wxHyperlinkCtrl", header: wxh.} = object of WxHyperlinkCtrlBase 65 | 66 | 67 | proc constructwxHyperlinkCtrl*(): WxHyperlinkCtrl {.cdecl, constructor, 68 | importcpp: "wxHyperlinkCtrl(@)", header: wxh.} 69 | proc constructwxHyperlinkCtrl*(parent: ptr WxWindow; id: WxWindowID; 70 | label: WxString; url: WxString; 71 | pos: WxPoint = wxDefaultPosition; 72 | size: WxSize = wxDefaultSize; 73 | style: clong = wxHL_DEFAULT_STYLE; 74 | name: WxString = constructWxString("hyperlink")): WxHyperlinkCtrl {. 75 | cdecl, constructor, importcpp: "wxHyperlinkCtrl(@)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/icon.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | var wxICON_DEFAULT_TYPE* {.importcpp: "wxICON_DEFAULT_TYPE", header: wxh.}: WxBitmapType 5 | 6 | type 7 | WxIcon* {.importcpp: "wxIcon", header: wxh.} = object of WxBitmap 8 | 9 | 10 | proc constructwxIcon*(): WxIcon {.cdecl, constructor, importcpp: "wxIcon(@)", 11 | header: wxh.} 12 | proc constructwxIcon*(bits: cstringArray): WxIcon {.cdecl, constructor, 13 | importcpp: "wxIcon(@)", header: wxh.} 14 | proc constructwxIcon*(filename: WxString; 15 | `type`: WxBitmapType = wxICON_DEFAULT_TYPE; 16 | desiredWidth: cint = - 1; desiredHeight: cint = - 1): WxIcon {. 17 | cdecl, constructor, importcpp: "wxIcon(@)", header: wxh.} 18 | proc loadFile*(this: var WxIcon; name: WxString; flags: WxBitmapType; 19 | desiredWidth: cint; desiredHeight: cint): bool {.cdecl, 20 | importcpp: "LoadFile", header: wxh.} 21 | proc loadFile*(this: var WxIcon; name: WxString; 22 | flags: WxBitmapType = wxICON_DEFAULT_TYPE): bool {.cdecl, 23 | importcpp: "LoadFile", header: wxh.} 24 | proc copyFromBitmap*(this: var WxIcon; bmp: WxBitmap) {.cdecl, 25 | importcpp: "CopyFromBitmap", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/kbdstate.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxKeyboardState* {.importcpp: "wxKeyboardState", header: wxh.} = object 6 | mControlDown* {.importc: "m_controlDown".}: bool 7 | mShiftDown* {.importc: "m_shiftDown".}: bool 8 | mAltDown* {.importc: "m_altDown".}: bool 9 | mMetaDown* {.importc: "m_metaDown".}: bool 10 | 11 | 12 | proc constructwxKeyboardState*(controlDown: bool = false; 13 | shiftDown: bool = false; altDown: bool = false; 14 | metaDown: bool = false): WxKeyboardState {.cdecl, 15 | constructor, importcpp: "wxKeyboardState(@)", header: wxh.} 16 | proc getModifiers*(this: WxKeyboardState): cint {.noSideEffect, cdecl, 17 | importcpp: "GetModifiers", header: wxh.} 18 | proc hasAnyModifiers*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 19 | importcpp: "HasAnyModifiers", header: wxh.} 20 | proc hasModifiers*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 21 | importcpp: "HasModifiers", header: wxh.} 22 | proc controlDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 23 | importcpp: "ControlDown", header: wxh.} 24 | proc rawControlDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 25 | importcpp: "RawControlDown", header: wxh.} 26 | proc shiftDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 27 | importcpp: "ShiftDown", header: wxh.} 28 | proc metaDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 29 | importcpp: "MetaDown", header: wxh.} 30 | proc altDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 31 | importcpp: "AltDown", header: wxh.} 32 | proc cmdDown*(this: WxKeyboardState): bool {.noSideEffect, cdecl, 33 | importcpp: "CmdDown", header: wxh.} 34 | proc setControlDown*(this: var WxKeyboardState; down: bool) {.cdecl, 35 | importcpp: "SetControlDown", header: wxh.} 36 | proc setRawControlDown*(this: var WxKeyboardState; down: bool) {.cdecl, 37 | importcpp: "SetRawControlDown", header: wxh.} 38 | proc setShiftDown*(this: var WxKeyboardState; down: bool) {.cdecl, 39 | importcpp: "SetShiftDown", header: wxh.} 40 | proc setAltDown*(this: var WxKeyboardState; down: bool) {.cdecl, 41 | importcpp: "SetAltDown", header: wxh.} 42 | proc setMetaDown*(this: var WxKeyboardState; down: bool) {.cdecl, 43 | importcpp: "SetMetaDown", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/list.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | discard "forward decl of wxObjectListNode" 5 | type 6 | WxNode* {.importcpp: "wxNode", header: wxh.} = object 7 | 8 | WxListSortFunction*[T] {.importcpp: "wxList_SortFunction", header: wxh.} = object 9 | 10 | 11 | proc constructwxListSortFunction*[T](f: WxSortCompareFunction): WxListSortFunction[ 12 | T] {.cdecl, constructor, importcpp: "wxList_SortFunction(@)", header: wxh.} 13 | proc call*[T](this: var WxListSortFunction[T]; i1: T; i2: T): bool {.cdecl, 14 | importcpp: "#(@)", header: wxh.} 15 | 16 | 17 | 18 | 19 | 20 | type 21 | WxObjectList* {.importcpp: "wxObjectList", header: wxh, inheritable.} = object 22 | 23 | 24 | proc constructwxObjectList*(): WxObjectList {.cdecl, constructor, 25 | importcpp: "wxObjectList(@)", header: wxh.} 26 | proc isEmpty*(this: WxObjectList): bool {.noSideEffect, cdecl, 27 | importcpp: "IsEmpty", header: wxh.} 28 | proc getCount*(this: WxObjectList): csize {.noSideEffect, cdecl, 29 | importcpp: "GetCount", header: wxh.} 30 | proc number*(this: WxObjectList): cint {.noSideEffect, cdecl, 31 | importcpp: "Number", header: wxh.} 32 | proc `[]`*(this: WxObjectList; idx: csize): ptr WxObject {.noSideEffect, cdecl, 33 | importcpp: "#[@]", header: wxh.} 34 | proc member*(this: WxObjectList; e: ptr WxObject): bool {.noSideEffect, cdecl, 35 | importcpp: "Member", header: wxh.} 36 | proc indexOf*(this: WxObjectList; e: ptr WxObject): cint {.noSideEffect, cdecl, 37 | importcpp: "IndexOf", header: wxh.} 38 | proc deleteContents*(this: var WxObjectList; destroy: bool) {.cdecl, 39 | importcpp: "DeleteContents", header: wxh.} 40 | proc getDeleteContents*(this: WxObjectList): bool {.noSideEffect, cdecl, 41 | importcpp: "GetDeleteContents", header: wxh.} 42 | proc deleteObject*(this: var WxObjectList; e: ptr WxObject): bool {.cdecl, 43 | importcpp: "DeleteObject", header: wxh.} 44 | proc clear*(this: var WxObjectList) {.cdecl, importcpp: "Clear", header: wxh.} 45 | proc sort*(this: var WxObjectList; compfunc: WxSortCompareFunction) {.cdecl, 46 | importcpp: "Sort", header: wxh.} 47 | proc destroywxObjectList*(this: var WxObjectList) {.cdecl, 48 | importcpp: "#.~wxObjectList()", header: wxh.} 49 | type 50 | WxList* {.importcpp: "wxList", header: wxh.} = object of WxObjectList 51 | 52 | 53 | proc constructwxList*(keyType = wxKEY_NONE): WxList {.cdecl, constructor, 54 | importcpp: "wxList(@)", header: wxh.} 55 | proc destroywxList*(this: var WxList) {.cdecl, importcpp: "#.~wxList()", 56 | header: wxh.} 57 | -------------------------------------------------------------------------------- /wxnim/private/listbook.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | discard "forward decl of wxListView" 4 | discard "forward decl of wxListEvent" 5 | type 6 | WxBookCtrlEvent* {.importcpp: "wxBookCtrlEvent", header: wxh.} = object 7 | 8 | 9 | var wxEVT_LISTBOOK_PAGE_CHANGED* {.importcpp: "wxEVT_LISTBOOK_PAGE_CHANGED", 10 | header: wxh.}: WxEventTypeTag[WxBookCtrlEvent] 11 | 12 | var wxEVT_LISTBOOK_PAGE_CHANGING* {.importcpp: "wxEVT_LISTBOOK_PAGE_CHANGING", 13 | header: wxh.}: WxEventTypeTag[ 14 | WxBookCtrlEvent] 15 | 16 | 17 | type 18 | WxListbook* {.importcpp: "wxListbook", header: wxh.} = object of WxControl 19 | 20 | 21 | proc constructwxListbook*(): WxListbook {.cdecl, constructor, 22 | importcpp: "wxListbook(@)", header: wxh.} 23 | proc constructwxListbook*(parent: ptr WxWindow; id: WxWindowID; 24 | pos: WxPoint = wxDefaultPosition; 25 | size: WxSize = wxDefaultSize; style: clong = 0; 26 | name: WxString = wxEmptyString): WxListbook {.cdecl, 27 | constructor, importcpp: "wxListbook(@)", header: wxh.} 28 | proc create*(this: var WxListbook; parent: ptr WxWindow; id: WxWindowID; 29 | pos: WxPoint = wxDefaultPosition; size: WxSize = wxDefaultSize; 30 | style: clong = 0; name: WxString = wxEmptyString): bool {.cdecl, 31 | importcpp: "Create", header: wxh.} 32 | proc setPageText*(this: var WxListbook; n: csize; strText: WxString): bool {. 33 | discardable, cdecl, importcpp: "SetPageText", header: wxh.} 34 | proc getPageText*(this: WxListbook; n: csize): WxString {.noSideEffect, cdecl, 35 | importcpp: "GetPageText", header: wxh.} 36 | proc getPageImage*(this: WxListbook; n: csize): cint {.noSideEffect, cdecl, 37 | importcpp: "GetPageImage", header: wxh.} 38 | proc setPageImage*(this: var WxListbook; n: csize; imageId: cint): bool {. 39 | discardable, cdecl, importcpp: "SetPageImage", header: wxh.} 40 | proc insertPage*(this: var WxListbook; n: csize; page: ptr WxWindow; 41 | text: WxString; bSelect: bool = false; imageId: cint = - 1): bool {. 42 | cdecl, importcpp: "InsertPage", header: wxh.} 43 | proc setSelection*(this: var WxListbook; n: csize): cint {.discardable, cdecl, 44 | importcpp: "SetSelection", header: wxh.} 45 | proc changeSelection*(this: var WxListbook; n: csize): cint {.cdecl, 46 | importcpp: "ChangeSelection", header: wxh.} 47 | proc hitTest*(this: WxListbook; pt: WxPoint; flags: ptr clong = nil): cint {. 48 | noSideEffect, cdecl, importcpp: "HitTest", header: wxh.} 49 | proc setImageList*(this: var WxListbook; imageList: ptr WxImageList) {.cdecl, 50 | importcpp: "SetImageList", header: wxh.} 51 | proc deleteAllPages*(this: var WxListbook): bool {.cdecl, 52 | importcpp: "DeleteAllPages", header: wxh.} 53 | proc getListView*(this: WxListbook): ptr WxListView {.noSideEffect, cdecl, 54 | importcpp: "GetListView", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/notebook.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | const 6 | wxNB_HITTEST_NOWHERE* = wxBK_HITTEST_NOWHERE 7 | wxNB_HITTEST_ONICON* = wxBK_HITTEST_ONICON 8 | wxNB_HITTEST_ONLABEL* = wxBK_HITTEST_ONLABEL 9 | wxNB_HITTEST_ONITEM* = wxBK_HITTEST_ONITEM 10 | wxNB_HITTEST_ONPAGE* = wxBK_HITTEST_ONPAGE 11 | 12 | 13 | const 14 | wxNB_DEFAULT* = wxBK_DEFAULT 15 | wxNB_TOP* = wxBK_TOP 16 | wxNB_BOTTOM* = wxBK_BOTTOM 17 | wxNB_LEFT* = wxBK_LEFT 18 | wxNB_RIGHT* = wxBK_RIGHT 19 | wxNB_FIXEDWIDTH* = 0x00000100 20 | wxNB_MULTILINE* = 0x00000200 21 | wxNB_NOPAGETHEME* = 0x00000400 22 | wxNB_FLAT* = 0x00000800 23 | 24 | type 25 | WxNotebookPage* = WxWindow 26 | 27 | 28 | type 29 | WxNotebookBase* {.importcpp: "wxNotebookBase", header: wxh.} = object of WxBookCtrlBase 30 | 31 | 32 | proc constructwxNotebookBase*(): WxNotebookBase {.cdecl, constructor, 33 | importcpp: "wxNotebookBase(@)", header: wxh.} 34 | proc getRowCount*(this: WxNotebookBase): cint {.noSideEffect, cdecl, 35 | importcpp: "GetRowCount", header: wxh.} 36 | proc setPadding*(this: var WxNotebookBase; padding: WxSize) {.cdecl, 37 | importcpp: "SetPadding", header: wxh.} 38 | proc setTabSize*(this: var WxNotebookBase; sz: WxSize) {.cdecl, 39 | importcpp: "SetTabSize", header: wxh.} 40 | proc calcSizeFromPage*(this: WxNotebookBase; sizePage: WxSize): WxSize {. 41 | noSideEffect, cdecl, importcpp: "CalcSizeFromPage", header: wxh.} 42 | proc getThemeBackgroundColour*(this: WxNotebookBase): WxColour {.noSideEffect, 43 | cdecl, importcpp: "GetThemeBackgroundColour", header: wxh.} 44 | proc sendPageChangingEvent*(this: var WxNotebookBase; nPage: cint): bool {. 45 | cdecl, importcpp: "SendPageChangingEvent", header: wxh.} 46 | proc sendPageChangedEvent*(this: var WxNotebookBase; nPageOld: cint; 47 | nPageNew: cint = wxNOT_FOUND) {.cdecl, 48 | importcpp: "SendPageChangedEvent", header: wxh.} 49 | proc acceptsFocus*(this: WxNotebookBase): bool {.noSideEffect, cdecl, 50 | importcpp: "AcceptsFocus", header: wxh.} 51 | 52 | const 53 | wxNotebookEvent* = wxBookCtrlEvent 54 | 55 | type 56 | WxNotebookEventFunction* = WxBookCtrlEventFunction 57 | 58 | template wxNotebookEventHandler*(`func`: untyped): untyped = 59 | wxBookCtrlEventHandler(`func`) 60 | 61 | var wxEVT_NOTEBOOK_PAGE_CHANGED* {.importcpp: "wxEVT_NOTEBOOK_PAGE_CHANGED", 62 | header: wxh.}: WxEventTypeTag[WxBookCtrlEvent] 63 | 64 | var wxEVT_NOTEBOOK_PAGE_CHANGING* {.importcpp: "wxEVT_NOTEBOOK_PAGE_CHANGING", 65 | header: wxh.}: WxEventTypeTag[ 66 | WxBookCtrlEvent] 67 | 68 | template evt_Notebook_Page_Changed*(winid, fn: untyped): untyped = 69 | wxDECLARE_EVT1(wxEVT_NOTEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn)) 70 | 71 | template evt_Notebook_Page_Changing*(winid, fn: untyped): untyped = 72 | wxDECLARE_EVT1(wxEVT_NOTEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn)) 73 | 74 | 75 | const 76 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED* = wxEVT_NOTEBOOK_PAGE_CHANGED 77 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING* = wxEVT_NOTEBOOK_PAGE_CHANGING 78 | 79 | -------------------------------------------------------------------------------- /wxnim/private/ownerdrw.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxDC* {.importcpp: "wxDC", header: wxh.} = object 5 | 6 | 7 | 8 | type 9 | WxOwnerDrawnBase* {.importcpp: "wxOwnerDrawnBase", header: wxh.} = object 10 | 11 | 12 | proc constructwxOwnerDrawnBase*(): WxOwnerDrawnBase {.cdecl, constructor, 13 | importcpp: "wxOwnerDrawnBase(@)", header: wxh.} 14 | proc destroywxOwnerDrawnBase*(this: var WxOwnerDrawnBase) {.cdecl, 15 | importcpp: "#.~wxOwnerDrawnBase()", header: wxh.} 16 | proc setFont*(this: var WxOwnerDrawnBase; font: WxFont) {.cdecl, 17 | importcpp: "SetFont", header: wxh.} 18 | proc getFont*(this: WxOwnerDrawnBase): var WxFont {.noSideEffect, cdecl, 19 | importcpp: "GetFont", header: wxh.} 20 | proc setTextColour*(this: var WxOwnerDrawnBase; colText: WxColour) {.cdecl, 21 | importcpp: "SetTextColour", header: wxh.} 22 | proc getTextColour*(this: WxOwnerDrawnBase): var WxColour {.noSideEffect, cdecl, 23 | importcpp: "GetTextColour", header: wxh.} 24 | proc setBackgroundColour*(this: var WxOwnerDrawnBase; colBack: WxColour) {. 25 | cdecl, importcpp: "SetBackgroundColour", header: wxh.} 26 | proc getBackgroundColour*(this: WxOwnerDrawnBase): var WxColour {.noSideEffect, 27 | cdecl, importcpp: "GetBackgroundColour", header: wxh.} 28 | proc setMarginWidth*(this: var WxOwnerDrawnBase; width: cint) {.cdecl, 29 | importcpp: "SetMarginWidth", header: wxh.} 30 | proc getMarginWidth*(this: WxOwnerDrawnBase): cint {.noSideEffect, cdecl, 31 | importcpp: "GetMarginWidth", header: wxh.} 32 | proc getDefaultMarginWidth*(): cint {.cdecl, importcpp: "wxOwnerDrawnBase::GetDefaultMarginWidth(@)", 33 | header: wxh.} 34 | proc getName*(this: WxOwnerDrawnBase): WxString {.noSideEffect, cdecl, 35 | importcpp: "GetName", header: wxh.} 36 | proc isOwnerDrawn*(this: WxOwnerDrawnBase): bool {.noSideEffect, cdecl, 37 | importcpp: "IsOwnerDrawn", header: wxh.} 38 | proc setOwnerDrawn*(this: var WxOwnerDrawnBase; ownerDrawn: bool = true) {. 39 | cdecl, importcpp: "SetOwnerDrawn", header: wxh.} 40 | type 41 | WxODAction* {.size: sizeof(cint), importcpp: "wxOwnerDrawnBase::wxODAction", 42 | header: wxh.} = enum 43 | wxODDrawAll = 0x00000001, wxODSelectChanged = 0x00000002, 44 | wxODFocusChanged = 0x00000004 45 | 46 | 47 | type 48 | WxODStatus* {.size: sizeof(cint), importcpp: "wxOwnerDrawnBase::wxODStatus", 49 | header: wxh.} = enum 50 | wxODSelected = 0x00000001, wxODGrayed = 0x00000002, 51 | wxODDisabled = 0x00000004, wxODChecked = 0x00000008, 52 | wxODHasFocus = 0x00000010, wxODDefault = 0x00000020, 53 | wxODHidePrefix = 0x00000100 54 | 55 | 56 | proc onMeasureItem*(this: var WxOwnerDrawnBase; width: ptr csize; 57 | height: ptr csize): bool {.cdecl, 58 | importcpp: "OnMeasureItem", header: wxh.} 59 | proc onDrawItem*(this: var WxOwnerDrawnBase; dc: var WxDC; rc: WxRect; 60 | act: WxODAction; stat: WxODStatus): bool {.cdecl, 61 | importcpp: "OnDrawItem", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/panel.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | discard "forward decl of wxControlContainer" 5 | type 6 | WxPanelBase* {.importcpp: "wxPanelBase", header: wxh.} = object of WxWindow 7 | 8 | 9 | proc constructwxPanelBase*(): WxPanelBase {.cdecl, constructor, 10 | importcpp: "wxPanelBase(@)", header: wxh.} 11 | proc create*(this: var WxPanelBase; parent: ptr WxWindow; 12 | id: WxWindowID = WxWindowID(wxID_ANY); 13 | pos: WxPoint = wxDefaultPosition; size: WxSize = wxDefaultSize; 14 | style: clong = int(wxTAB_TRAVERSAL) or int(wxNO_BORDER); 15 | name: WxString = constructWxString("panel")): bool {.cdecl, 16 | importcpp: "Create", header: wxh.} 17 | proc initDialog*(this: var WxPanelBase) {.cdecl, importcpp: "InitDialog", 18 | header: wxh.} 19 | type 20 | WxPanel* {.importcpp: "wxPanel", header: wxh.} = object of WxPanelBase 21 | 22 | 23 | proc constructwxPanel*(): WxPanel {.cdecl, constructor, importcpp: "wxPanel(@)", 24 | header: wxh.} 25 | proc constructwxPanel*(parent: ptr WxWindow; 26 | id: WxWindowID = WxWindowID(wxID_ANY); 27 | pos: WxPoint = wxDefaultPosition; 28 | size: WxSize = wxDefaultSize; 29 | style: clong = int(wxTAB_TRAVERSAL) or int(wxNO_BORDER); 30 | name: WxString = constructWxString("panel")): WxPanel {. 31 | cdecl, constructor, importcpp: "wxPanel(@)", header: wxh.} 32 | proc hasTransparentBackground*(this: var WxPanel): bool {.cdecl, 33 | importcpp: "HasTransparentBackground", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/position.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxPosition* {.importcpp: "wxPosition", header: wxh.} = object 5 | 6 | 7 | proc constructwxPosition*(): WxPosition {.cdecl, constructor, 8 | importcpp: "wxPosition(@)", header: wxh.} 9 | proc constructwxPosition*(row: cint; col: cint): WxPosition {.cdecl, 10 | constructor, importcpp: "wxPosition(@)", header: wxh.} 11 | proc getRow*(this: WxPosition): cint {.noSideEffect, cdecl, importcpp: "GetRow", 12 | header: wxh.} 13 | proc getColumn*(this: WxPosition): cint {.noSideEffect, cdecl, 14 | importcpp: "GetColumn", header: wxh.} 15 | proc getCol*(this: WxPosition): cint {.noSideEffect, cdecl, importcpp: "GetCol", 16 | header: wxh.} 17 | proc setRow*(this: var WxPosition; row: cint) {.cdecl, importcpp: "SetRow", 18 | header: wxh.} 19 | proc setColumn*(this: var WxPosition; column: cint) {.cdecl, 20 | importcpp: "SetColumn", header: wxh.} 21 | proc setCol*(this: var WxPosition; column: cint) {.cdecl, importcpp: "SetCol", 22 | header: wxh.} 23 | proc `==`*(this: WxPosition; p: WxPosition): bool {.noSideEffect, cdecl, 24 | importcpp: "(# == #)", header: wxh.} 25 | proc `+=`*(this: var WxPosition; p: WxPosition) {.cdecl, importcpp: "(# += #)", 26 | header: wxh.} 27 | proc `-=`*(this: var WxPosition; p: WxPosition) {.cdecl, importcpp: "(# -= #)", 28 | header: wxh.} 29 | proc `+=`*(this: var WxPosition; s: WxSize) {.cdecl, importcpp: "(# += #)", 30 | header: wxh.} 31 | proc `-=`*(this: var WxPosition; s: WxSize) {.cdecl, importcpp: "(# -= #)", 32 | header: wxh.} 33 | proc `+`*(this: WxPosition; p: WxPosition): WxPosition {.noSideEffect, cdecl, 34 | importcpp: "(# + #)", header: wxh.} 35 | proc `-`*(this: WxPosition; p: WxPosition): WxPosition {.noSideEffect, cdecl, 36 | importcpp: "(# - #)", header: wxh.} 37 | proc `+`*(this: WxPosition; s: WxSize): WxPosition {.noSideEffect, cdecl, 38 | importcpp: "(# + #)", header: wxh.} 39 | proc `-`*(this: WxPosition; s: WxSize): WxPosition {.noSideEffect, cdecl, 40 | importcpp: "(# - #)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/radiobut.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxRadioButton* {.importcpp: "wxRadioButton", header: wxh.} = object of WxCheckBox 6 | 7 | 8 | proc constructwxRadioButton*(): WxRadioButton {.cdecl, constructor, 9 | importcpp: "wxRadioButton(@)", header: wxh.} 10 | proc constructwxRadioButton*(parent: ptr WxWindow; id: WxWindowID; 11 | label: WxString; pos: WxPoint = wxDefaultPosition; 12 | size: WxSize = wxDefaultSize; style: clong = 0; 13 | validator: WxValidator = wxDefaultValidator; 14 | name: WxString = constructWxString("radioButton")): WxRadioButton {. 15 | cdecl, constructor, importcpp: "wxRadioButton(@)", header: wxh.} 16 | proc create*(this: var WxRadioButton; parent: ptr WxWindow; id: WxWindowID; 17 | label: WxString; pos: WxPoint = wxDefaultPosition; 18 | size: WxSize = wxDefaultSize; style: clong = 0; 19 | validator: WxValidator = wxDefaultValidator; 20 | name: WxString = constructWxString("radioButton")): bool {.cdecl, 21 | importcpp: "Create", header: wxh.} 22 | proc changeValue*(this: var WxRadioButton; value: bool) {.cdecl, 23 | importcpp: "ChangeValue", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/richtext/richtextbackgroundpage.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | discard "forward decl of wxRichTextColourSwatchCtrl" 7 | const 8 | ID_RICHTEXTBACKGROUNDPAGE* = 10845 9 | ID_RICHTEXT_BACKGROUND_COLOUR_CHECKBOX* = 10846 10 | ID_RICHTEXT_BACKGROUND_COLOUR_SWATCH* = 10847 11 | 12 | 13 | template symbol_Wxrichtextbackgroundpage_Style*(): untyped = 14 | wxTAB_TRAVERSAL 15 | 16 | template symbol_Wxrichtextbackgroundpage_Title*(): untyped = 17 | wxEmptyString 18 | 19 | template symbol_Wxrichtextbackgroundpage_Idname*(): untyped = 20 | WxWindowID(ID_RICHTEXTBACKGROUNDPAGE) 21 | 22 | template symbol_Wxrichtextbackgroundpage_Size*(): untyped = 23 | constructWxSize(400, 300) 24 | 25 | template symbol_Wxrichtextbackgroundpage_Position*(): untyped = 26 | wxDefaultPosition 27 | 28 | 29 | type 30 | WxRichTextBackgroundPage* {.importcpp: "wxRichTextBackgroundPage", header: wxh.} = object of WxRichTextDialogPage 31 | mBackgroundColourCheckBox* {.importc: "m_backgroundColourCheckBox".}: ptr WxCheckBox 32 | mBackgroundColourSwatch* {.importc: "m_backgroundColourSwatch".}: ptr WxRichTextColourSwatchCtrl 33 | 34 | 35 | proc constructwxRichTextBackgroundPage*(): WxRichTextBackgroundPage {.cdecl, 36 | constructor, importcpp: "wxRichTextBackgroundPage(@)", header: wxh.} 37 | proc constructwxRichTextBackgroundPage*(parent: ptr WxWindow; id: WxWindowID = symbol_Wxrichtextbackgroundpage_Idname; 38 | pos: WxPoint = symbol_Wxrichtextbackgroundpage_Position; size: WxSize = symbol_Wxrichtextbackgroundpage_Size; 39 | style: clong = symbol_Wxrichtextbackgroundpage_Style): WxRichTextBackgroundPage {. 40 | cdecl, constructor, importcpp: "wxRichTextBackgroundPage(@)", header: wxh.} 41 | proc create*(this: var WxRichTextBackgroundPage; parent: ptr WxWindow; 42 | id: WxWindowID = symbol_Wxrichtextbackgroundpage_Idname; 43 | pos: WxPoint = symbol_Wxrichtextbackgroundpage_Position; 44 | size: WxSize = symbol_Wxrichtextbackgroundpage_Size; 45 | style: clong = symbol_Wxrichtextbackgroundpage_Style): bool {. 46 | cdecl, importcpp: "Create", header: wxh.} 47 | proc destroywxRichTextBackgroundPage*(this: var WxRichTextBackgroundPage) {. 48 | cdecl, importcpp: "#.~wxRichTextBackgroundPage()", header: wxh.} 49 | proc init*(this: var WxRichTextBackgroundPage) {.cdecl, importcpp: "Init", 50 | header: wxh.} 51 | proc createControls*(this: var WxRichTextBackgroundPage) {.cdecl, 52 | importcpp: "CreateControls", header: wxh.} 53 | proc getAttributes*(this: var WxRichTextBackgroundPage): ptr WxRichTextAttr {. 54 | cdecl, importcpp: "GetAttributes", header: wxh.} 55 | proc transferDataToWindow*(this: var WxRichTextBackgroundPage): bool {.cdecl, 56 | importcpp: "TransferDataToWindow", header: wxh.} 57 | proc transferDataFromWindow*(this: var WxRichTextBackgroundPage): bool {.cdecl, 58 | importcpp: "TransferDataFromWindow", header: wxh.} 59 | proc onColourSwatch*(this: var WxRichTextBackgroundPage; 60 | event: var WxCommandEvent) {.cdecl, 61 | importcpp: "OnColourSwatch", header: wxh.} 62 | proc getBitmapResource*(this: var WxRichTextBackgroundPage; name: WxString): WxBitmap {. 63 | cdecl, importcpp: "GetBitmapResource", header: wxh.} 64 | proc getIconResource*(this: var WxRichTextBackgroundPage; name: WxString): WxIcon {. 65 | cdecl, importcpp: "GetIconResource", header: wxh.} 66 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtextdialogpage.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxRichTextDialogPage* {.importcpp: "wxRichTextDialogPage", header: wxh.} = object of WxPanel 6 | 7 | 8 | proc constructwxRichTextDialogPage*(): WxRichTextDialogPage {.cdecl, 9 | constructor, importcpp: "wxRichTextDialogPage(@)", header: wxh.} 10 | proc constructwxRichTextDialogPage*(parent: ptr WxWindow; 11 | id: WxWindowID = wxID_ANY; 12 | pos: WxPoint = wxDefaultPosition; 13 | size: WxSize = wxDefaultSize; 14 | style: clong = 0): WxRichTextDialogPage {. 15 | cdecl, constructor, importcpp: "wxRichTextDialogPage(@)", header: wxh.} 16 | 17 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtexthtml.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | const 6 | wxRICHTEXT_HANDLER_USE_CSS* = 0x00001000 7 | 8 | 9 | type 10 | WxRichTextHTMLHandler* {.importcpp: "wxRichTextHTMLHandler", header: wxh.} = object of WxRichTextFileHandler 11 | 12 | 13 | proc constructwxRichTextHTMLHandler*(name: WxString = "HTML"; 14 | ext: WxString = "html"; 15 | `type` = wxRICHTEXT_TYPE_HTML): WxRichTextHTMLHandler {. 16 | cdecl, constructor, importcpp: "wxRichTextHTMLHandler(@)", header: wxh.} 17 | proc canSave*(this: WxRichTextHTMLHandler): bool {.noSideEffect, cdecl, 18 | importcpp: "CanSave", header: wxh.} 19 | proc canLoad*(this: WxRichTextHTMLHandler): bool {.noSideEffect, cdecl, 20 | importcpp: "CanLoad", header: wxh.} 21 | proc canHandle*(this: WxRichTextHTMLHandler; filename: WxString): bool {. 22 | noSideEffect, cdecl, importcpp: "CanHandle", header: wxh.} 23 | proc setTemporaryImageLocations*(this: var WxRichTextHTMLHandler; 24 | locations: WxArrayString) {.cdecl, 25 | importcpp: "SetTemporaryImageLocations", header: wxh.} 26 | proc getTemporaryImageLocations*(this: WxRichTextHTMLHandler): WxArrayString {. 27 | noSideEffect, cdecl, importcpp: "GetTemporaryImageLocations", header: wxh.} 28 | proc clearTemporaryImageLocations*(this: var WxRichTextHTMLHandler) {.cdecl, 29 | importcpp: "ClearTemporaryImageLocations", header: wxh.} 30 | proc deleteTemporaryImages*(this: var WxRichTextHTMLHandler): bool {.cdecl, 31 | importcpp: "DeleteTemporaryImages", header: wxh.} 32 | proc deleteTemporaryImages*(flags: cint; imageLocations: WxArrayString): bool {. 33 | cdecl, importcpp: "wxRichTextHTMLHandler::DeleteTemporaryImages(@)", 34 | header: wxh.} 35 | proc setFileCounter*(counter: cint) {.cdecl, importcpp: "wxRichTextHTMLHandler::SetFileCounter(@)", 36 | header: wxh.} 37 | proc setTempDir*(this: var WxRichTextHTMLHandler; tempDir: WxString) {.cdecl, 38 | importcpp: "SetTempDir", header: wxh.} 39 | proc getTempDir*(this: WxRichTextHTMLHandler): WxString {.noSideEffect, cdecl, 40 | importcpp: "GetTempDir", header: wxh.} 41 | proc setFontSizeMapping*(this: var WxRichTextHTMLHandler; 42 | fontSizeMapping: WxArrayInt) {.cdecl, 43 | importcpp: "SetFontSizeMapping", header: wxh.} 44 | proc getFontSizeMapping*(this: WxRichTextHTMLHandler): WxArrayInt {. 45 | noSideEffect, cdecl, importcpp: "GetFontSizeMapping", header: wxh.} 46 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtextimagedlg.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | discard "forward decl of wxButton" 5 | discard "forward decl of wxComboBox" 6 | discard "forward decl of wxCheckBox" 7 | discard "forward decl of wxTextCtrl" 8 | 9 | const 10 | ID_RICHTEXTOBJECTPROPERTIESDIALOG* = 10650 11 | 12 | template symbol_Wxrichtextobjectpropertiesdialog_Style*(): untyped = 13 | wxDEFAULT_DIALOG_STYLE or wxTAB_TRAVERSAL 14 | 15 | template symbol_Wxrichtextobjectpropertiesdialog_Title*(): untyped = 16 | "Object Properties" 17 | 18 | template symbol_Wxrichtextobjectpropertiesdialog_Idname*(): untyped = 19 | WxWindowID(ID_RICHTEXTOBJECTPROPERTIESDIALOG) 20 | 21 | template symbol_Wxrichtextobjectpropertiesdialog_Size*(): untyped = 22 | constructWxSize(400, 300) 23 | 24 | template symbol_Wxrichtextobjectpropertiesdialog_Position*(): untyped = 25 | wxDefaultPosition 26 | 27 | 28 | type 29 | WxRichTextObjectPropertiesDialog* {.importcpp: "wxRichTextObjectPropertiesDialog", 30 | header: wxh.} = object of WxRichTextFormattingDialog 31 | 32 | 33 | proc constructwxRichTextObjectPropertiesDialog*(): WxRichTextObjectPropertiesDialog {. 34 | cdecl, constructor, importcpp: "wxRichTextObjectPropertiesDialog(@)", 35 | header: wxh.} 36 | proc constructwxRichTextObjectPropertiesDialog*(obj: ptr WxRichTextObject; 37 | parent: ptr WxWindow; 38 | id: WxWindowID = symbol_Wxrichtextobjectpropertiesdialog_Idname; 39 | caption: WxString = symbol_Wxrichtextobjectpropertiesdialog_Title; 40 | pos: WxPoint = symbol_Wxrichtextobjectpropertiesdialog_Position; 41 | size: WxSize = symbol_Wxrichtextobjectpropertiesdialog_Size; 42 | style: clong = symbol_Wxrichtextobjectpropertiesdialog_Style): WxRichTextObjectPropertiesDialog {. 43 | cdecl, constructor, importcpp: "wxRichTextObjectPropertiesDialog(@)", 44 | header: wxh.} 45 | proc create*(this: var WxRichTextObjectPropertiesDialog; 46 | obj: ptr WxRichTextObject; parent: ptr WxWindow; 47 | id: WxWindowID = symbol_Wxrichtextobjectpropertiesdialog_Idname; 48 | caption: WxString = symbol_Wxrichtextobjectpropertiesdialog_Title; 49 | pos: WxPoint = symbol_Wxrichtextobjectpropertiesdialog_Position; 50 | size: WxSize = symbol_Wxrichtextobjectpropertiesdialog_Size; 51 | style: clong = symbol_Wxrichtextobjectpropertiesdialog_Style): bool {. 52 | cdecl, importcpp: "Create", header: wxh.} 53 | proc destroywxRichTextObjectPropertiesDialog*( 54 | this: var WxRichTextObjectPropertiesDialog) {.cdecl, 55 | importcpp: "#.~wxRichTextObjectPropertiesDialog()", header: wxh.} 56 | proc init*(this: var WxRichTextObjectPropertiesDialog) {.cdecl, 57 | importcpp: "Init", header: wxh.} 58 | proc createControls*(this: var WxRichTextObjectPropertiesDialog) {.cdecl, 59 | importcpp: "CreateControls", header: wxh.} 60 | proc getBitmapResource*(this: var WxRichTextObjectPropertiesDialog; 61 | name: WxString): WxBitmap {.cdecl, 62 | importcpp: "GetBitmapResource", header: wxh.} 63 | proc getIconResource*(this: var WxRichTextObjectPropertiesDialog; name: WxString): WxIcon {. 64 | cdecl, importcpp: "GetIconResource", header: wxh.} 65 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtextstylepage.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | ID_RICHTEXTSTYLEPAGE* = 10403 6 | ID_RICHTEXTSTYLEPAGE_STYLE_NAME* = 10404 7 | ID_RICHTEXTSTYLEPAGE_BASED_ON* = 10405 8 | ID_RICHTEXTSTYLEPAGE_NEXT_STYLE* = 10406 9 | 10 | 11 | template symbol_Wxrichtextstylepage_Style*(): untyped = 12 | wxRESIZE_BORDER or wxTAB_TRAVERSAL 13 | 14 | template symbol_Wxrichtextstylepage_Title*(): untyped = 15 | wxEmptyString 16 | 17 | template symbol_Wxrichtextstylepage_Idname*(): untyped = 18 | WxWindowID(ID_RICHTEXTSTYLEPAGE) 19 | 20 | template symbol_Wxrichtextstylepage_Size*(): untyped = 21 | constructwxSize(400, 300) 22 | 23 | template symbol_Wxrichtextstylepage_Position*(): untyped = 24 | wxDefaultPosition 25 | 26 | 27 | type 28 | WxRichTextStylePage* {.importcpp: "wxRichTextStylePage", header: wxh.} = object of WxRichTextDialogPage 29 | mStyleName* {.importc: "m_styleName".}: ptr WxTextCtrl 30 | mBasedOn* {.importc: "m_basedOn".}: ptr WxComboBox 31 | mNextStyle* {.importc: "m_nextStyle".}: ptr WxComboBox 32 | 33 | 34 | proc constructwxRichTextStylePage*(): WxRichTextStylePage {.cdecl, constructor, 35 | importcpp: "wxRichTextStylePage(@)", header: wxh.} 36 | proc constructwxRichTextStylePage*(parent: ptr WxWindow; 37 | id: WxWindowID = wxID_ANY; pos: WxPoint = symbol_Wxrichtextstylepage_Position; 38 | size: WxSize = symbol_Wxrichtextstylepage_Size; style: clong = symbol_Wxrichtextstylepage_Style): WxRichTextStylePage {. 39 | cdecl, constructor, importcpp: "wxRichTextStylePage(@)", header: wxh.} 40 | proc create*(this: var WxRichTextStylePage; parent: ptr WxWindow; 41 | id: WxWindowID = wxID_ANY; 42 | pos: WxPoint = symbol_Wxrichtextstylepage_Position; 43 | size: WxSize = symbol_Wxrichtextstylepage_Size; 44 | style: clong = symbol_Wxrichtextstylepage_Style): bool {.cdecl, 45 | importcpp: "Create", header: wxh.} 46 | proc init*(this: var WxRichTextStylePage) {.cdecl, importcpp: "Init", 47 | header: wxh.} 48 | proc createControls*(this: var WxRichTextStylePage) {.cdecl, 49 | importcpp: "CreateControls", header: wxh.} 50 | proc transferDataFromWindow*(this: var WxRichTextStylePage): bool {.cdecl, 51 | importcpp: "TransferDataFromWindow", header: wxh.} 52 | proc transferDataToWindow*(this: var WxRichTextStylePage): bool {.cdecl, 53 | importcpp: "TransferDataToWindow", header: wxh.} 54 | proc getAttributes*(this: var WxRichTextStylePage): ptr WxRichTextAttr {.cdecl, 55 | importcpp: "GetAttributes", header: wxh.} 56 | proc onNextStyleUpdate*(this: var WxRichTextStylePage; 57 | event: var WxUpdateUIEvent) {.cdecl, 58 | importcpp: "OnNextStyleUpdate", header: wxh.} 59 | proc getBitmapResource*(this: var WxRichTextStylePage; name: WxString): WxBitmap {. 60 | cdecl, importcpp: "GetBitmapResource", header: wxh.} 61 | proc getIconResource*(this: var WxRichTextStylePage; name: WxString): WxIcon {. 62 | cdecl, importcpp: "GetIconResource", header: wxh.} 63 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtexttabspage.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | const 6 | ID_RICHTEXTTABSPAGE* = 10200 7 | ID_RICHTEXTTABSPAGE_TABEDIT* = 10213 8 | ID_RICHTEXTTABSPAGE_TABLIST* = 10214 9 | ID_RICHTEXTTABSPAGE_NEW_TAB* = 10201 10 | ID_RICHTEXTTABSPAGE_DELETE_TAB* = 10202 11 | ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS* = 10203 12 | 13 | 14 | template symbol_Wxrichtexttabspage_Style*(): untyped = 15 | wxRESIZE_BORDER or wxTAB_TRAVERSAL 16 | 17 | template symbol_Wxrichtexttabspage_Title*(): untyped = 18 | wxEmptyString 19 | 20 | template symbol_Wxrichtexttabspage_Idname*(): untyped = 21 | id_Richtexttabspage 22 | 23 | template symbol_Wxrichtexttabspage_Size*(): untyped = 24 | constructwxSize(400, 300) 25 | 26 | template symbol_Wxrichtexttabspage_Position*(): untyped = 27 | wxDefaultPosition 28 | 29 | 30 | type 31 | WxRichTextTabsPage* {.importcpp: "wxRichTextTabsPage", header: wxh.} = object of WxRichTextDialogPage 32 | mTabEditCtrl* {.importc: "m_tabEditCtrl".}: ptr WxTextCtrl 33 | mTabListCtrl* {.importc: "m_tabListCtrl".}: ptr WxListBox 34 | mTabsPresent* {.importc: "m_tabsPresent".}: bool 35 | 36 | 37 | proc constructwxRichTextTabsPage*(): WxRichTextTabsPage {.cdecl, constructor, 38 | importcpp: "wxRichTextTabsPage(@)", header: wxh.} 39 | proc constructwxRichTextTabsPage*(parent: ptr WxWindow; 40 | id: WxWindowID = wxID_ANY; pos: WxPoint = symbol_Wxrichtexttabspage_Position; 41 | size: WxSize = symbol_Wxrichtexttabspage_Size; style: clong = symbol_Wxrichtexttabspage_Style): WxRichTextTabsPage {. 42 | cdecl, constructor, importcpp: "wxRichTextTabsPage(@)", header: wxh.} 43 | proc create*(this: var WxRichTextTabsPage; parent: ptr WxWindow; 44 | id: WxWindowID = wxID_ANY; 45 | pos: WxPoint = symbol_Wxrichtexttabspage_Position; 46 | size: WxSize = symbol_Wxrichtexttabspage_Size; 47 | style: clong = symbol_Wxrichtexttabspage_Style): bool {.cdecl, 48 | importcpp: "Create", header: wxh.} 49 | proc createControls*(this: var WxRichTextTabsPage) {.cdecl, 50 | importcpp: "CreateControls", header: wxh.} 51 | proc init*(this: var WxRichTextTabsPage) {.cdecl, importcpp: "Init", header: wxh.} 52 | proc transferDataFromWindow*(this: var WxRichTextTabsPage): bool {.cdecl, 53 | importcpp: "TransferDataFromWindow", header: wxh.} 54 | proc transferDataToWindow*(this: var WxRichTextTabsPage): bool {.cdecl, 55 | importcpp: "TransferDataToWindow", header: wxh.} 56 | proc sortTabs*(this: var WxRichTextTabsPage) {.cdecl, importcpp: "SortTabs", 57 | header: wxh.} 58 | proc getAttributes*(this: var WxRichTextTabsPage): ptr WxRichTextAttr {.cdecl, 59 | importcpp: "GetAttributes", header: wxh.} 60 | proc onTablistSelected*(this: var WxRichTextTabsPage; event: var WxCommandEvent) {. 61 | cdecl, importcpp: "OnTablistSelected", header: wxh.} 62 | proc onNewTabClick*(this: var WxRichTextTabsPage; event: var WxCommandEvent) {. 63 | cdecl, importcpp: "OnNewTabClick", header: wxh.} 64 | proc onNewTabUpdate*(this: var WxRichTextTabsPage; event: var WxUpdateUIEvent) {. 65 | cdecl, importcpp: "OnNewTabUpdate", header: wxh.} 66 | proc onDeleteTabClick*(this: var WxRichTextTabsPage; event: var WxCommandEvent) {. 67 | cdecl, importcpp: "OnDeleteTabClick", header: wxh.} 68 | proc onDeleteTabUpdate*(this: var WxRichTextTabsPage; event: var WxUpdateUIEvent) {. 69 | cdecl, importcpp: "OnDeleteTabUpdate", header: wxh.} 70 | proc onDeleteAllTabsClick*(this: var WxRichTextTabsPage; 71 | event: var WxCommandEvent) {.cdecl, 72 | importcpp: "OnDeleteAllTabsClick", header: wxh.} 73 | proc onDeleteAllTabsUpdate*(this: var WxRichTextTabsPage; 74 | event: var WxUpdateUIEvent) {.cdecl, 75 | importcpp: "OnDeleteAllTabsUpdate", header: wxh.} 76 | proc getBitmapResource*(this: var WxRichTextTabsPage; name: WxString): WxBitmap {. 77 | cdecl, importcpp: "GetBitmapResource", header: wxh.} 78 | proc getIconResource*(this: var WxRichTextTabsPage; name: WxString): WxIcon {. 79 | cdecl, importcpp: "GetIconResource", header: wxh.} 80 | -------------------------------------------------------------------------------- /wxnim/private/richtext/richtextuicustomization.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxRichTextUICustomization* {.importcpp: "wxRichTextUICustomization", 6 | header: wxh.} = object 7 | 8 | 9 | proc constructwxRichTextUICustomization*(): WxRichTextUICustomization {.cdecl, 10 | constructor, importcpp: "wxRichTextUICustomization(@)", header: wxh.} 11 | proc destroywxRichTextUICustomization*(this: var WxRichTextUICustomization) {. 12 | cdecl, importcpp: "#.~wxRichTextUICustomization()", header: wxh.} 13 | proc showHelp*(this: var WxRichTextUICustomization; win: ptr WxWindow; id: clong): bool {. 14 | discardable, cdecl, importcpp: "ShowHelp", header: wxh.} 15 | 16 | type 17 | WxRichTextHelpInfo* {.importcpp: "wxRichTextHelpInfo", header: wxh.} = object 18 | 19 | 20 | proc constructwxRichTextHelpInfo*(): WxRichTextHelpInfo {.cdecl, constructor, 21 | importcpp: "wxRichTextHelpInfo(@)", header: wxh.} 22 | proc destroywxRichTextHelpInfo*(this: var WxRichTextHelpInfo) {.cdecl, 23 | importcpp: "#.~wxRichTextHelpInfo()", header: wxh.} 24 | proc showHelp*(this: var WxRichTextHelpInfo; win: ptr WxWindow): bool {. 25 | discardable, cdecl, importcpp: "ShowHelp", header: wxh.} 26 | proc getHelpId*(this: WxRichTextHelpInfo): clong {.noSideEffect, cdecl, 27 | importcpp: "GetHelpId", header: wxh.} 28 | proc setHelpId*(this: var WxRichTextHelpInfo; id: clong) {.cdecl, 29 | importcpp: "SetHelpId", header: wxh.} 30 | proc getUICustomization*(this: WxRichTextHelpInfo): ptr WxRichTextUICustomization {. 31 | noSideEffect, cdecl, importcpp: "GetUICustomization", header: wxh.} 32 | proc setUICustomization*(this: var WxRichTextHelpInfo; 33 | customization: ptr WxRichTextUICustomization) {.cdecl, 34 | importcpp: "SetUICustomization", header: wxh.} 35 | proc hasHelpId*(this: WxRichTextHelpInfo): bool {.noSideEffect, cdecl, 36 | importcpp: "HasHelpId", header: wxh.} 37 | proc hasUICustomization*(this: WxRichTextHelpInfo): bool {.noSideEffect, cdecl, 38 | importcpp: "HasUICustomization", header: wxh.} 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /wxnim/private/richtextbackgroundpage.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | discard "forward decl of wxRichTextColourSwatchCtrl" 7 | const 8 | SYMBOL_WXRICHTEXTBACKGROUNDPAGE_STYLE* = wxTAB_TRAVERSAL 9 | SYMBOL_WXRICHTEXTBACKGROUNDPAGE_TITLE* = wxEmptyString 10 | SYMBOL_WXRICHTEXTBACKGROUNDPAGE_IDNAME* = id_Richtextbackgroundpage 11 | SYMBOL_WXRICHTEXTBACKGROUNDPAGE_SIZE* = wxSize(400, 300) 12 | SYMBOL_WXRICHTEXTBACKGROUNDPAGE_POSITION* = wxDefaultPosition 13 | 14 | 15 | type 16 | WxRichTextBackgroundPage* {.importcpp: "wxRichTextBackgroundPage", header: wxh.} = object of WxRichTextDialogPage 17 | mBackgroundColourCheckBox* {.importc: "m_backgroundColourCheckBox".}: ptr WxCheckBox 18 | mBackgroundColourSwatch* {.importc: "m_backgroundColourSwatch".}: ptr WxRichTextColourSwatchCtrl 19 | 20 | 21 | proc constructwxRichTextBackgroundPage*(): WxRichTextBackgroundPage {.cdecl, 22 | constructor, importcpp: "wxRichTextBackgroundPage(@)", header: wxh.} 23 | proc constructwxRichTextBackgroundPage*(parent: ptr WxWindow; id: WxWindowID = symbol_Wxrichtextbackgroundpage_Idname; 24 | pos: WxPoint = symbol_Wxrichtextbackgroundpage_Position; size: WxSize = symbol_Wxrichtextbackgroundpage_Size; 25 | style: clong = symbol_Wxrichtextbackgroundpage_Style): WxRichTextBackgroundPage {. 26 | cdecl, constructor, importcpp: "wxRichTextBackgroundPage(@)", header: wxh.} 27 | proc create*(this: var WxRichTextBackgroundPage; parent: ptr WxWindow; 28 | id: WxWindowID = symbol_Wxrichtextbackgroundpage_Idname; 29 | pos: WxPoint = symbol_Wxrichtextbackgroundpage_Position; 30 | size: WxSize = symbol_Wxrichtextbackgroundpage_Size; 31 | style: clong = symbol_Wxrichtextbackgroundpage_Style): bool {. 32 | cdecl, importcpp: "Create", header: wxh.} 33 | proc destroywxRichTextBackgroundPage*(this: var WxRichTextBackgroundPage) {. 34 | cdecl, importcpp: "#.~wxRichTextBackgroundPage()", header: wxh.} 35 | proc init*(this: var WxRichTextBackgroundPage) {.cdecl, importcpp: "Init", 36 | header: wxh.} 37 | proc createControls*(this: var WxRichTextBackgroundPage) {.cdecl, 38 | importcpp: "CreateControls", header: wxh.} 39 | proc getAttributes*(this: var WxRichTextBackgroundPage): ptr WxRichTextAttr {. 40 | cdecl, importcpp: "GetAttributes", header: wxh.} 41 | proc transferDataToWindow*(this: var WxRichTextBackgroundPage): bool {.cdecl, 42 | importcpp: "TransferDataToWindow", header: wxh.} 43 | proc transferDataFromWindow*(this: var WxRichTextBackgroundPage): bool {.cdecl, 44 | importcpp: "TransferDataFromWindow", header: wxh.} 45 | proc onColourSwatch*(this: var WxRichTextBackgroundPage; 46 | event: var WxCommandEvent) {.cdecl, 47 | importcpp: "OnColourSwatch", header: wxh.} 48 | proc getBitmapResource*(this: var WxRichTextBackgroundPage; name: WxString): WxBitmap {. 49 | cdecl, importcpp: "GetBitmapResource", header: wxh.} 50 | proc getIconResource*(this: var WxRichTextBackgroundPage; name: WxString): WxIcon {. 51 | cdecl, importcpp: "GetIconResource", header: wxh.} 52 | proc showToolTips*(): bool {.cdecl, importcpp: "wxRichTextBackgroundPage::ShowToolTips(@)", 53 | header: wxh.} 54 | const 55 | ID_RICHTEXTBACKGROUNDPAGE* = 10845 56 | ID_RICHTEXT_BACKGROUND_COLOUR_CHECKBOX* = 10846 57 | ID_RICHTEXT_BACKGROUND_COLOUR_SWATCH* = 10847 58 | 59 | -------------------------------------------------------------------------------- /wxnim/private/richtooltip.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | discard "forward decl of wxFont" 4 | discard "forward decl of wxIcon" 5 | discard "forward decl of wxWindow" 6 | discard "forward decl of wxRichToolTipImpl" 7 | type 8 | WxTipKind* {.size: sizeof(cint), importcpp: "wxRichToolTipImpl::wxTipKind", 9 | header: wxh.} = enum 10 | wxTipKindNone, wxTipKindTopLeft, wxTipKindTop, wxTipKindTopRight, 11 | wxTipKindBottomLeft, wxTipKindBottom, wxTipKindBottomRight, wxTipKindAuto 12 | 13 | 14 | 15 | type 16 | WxRichToolTip* {.importcpp: "wxRichToolTip", header: wxh.} = object 17 | 18 | 19 | proc constructwxRichToolTip*(title: WxString; message: WxString): WxRichToolTip {. 20 | cdecl, constructor, importcpp: "wxRichToolTip(@)", header: wxh.} 21 | proc setBackgroundColour*(this: var WxRichToolTip; col: WxColour; 22 | colEnd: WxColour = wxColour()) {.cdecl, 23 | importcpp: "SetBackgroundColour", header: wxh.} 24 | proc setIcon*(this: var WxRichToolTip; icon: cint = wxICON_INFORMATION) {.cdecl, 25 | importcpp: "SetIcon", header: wxh.} 26 | proc setIcon*(this: var WxRichToolTip; icon: WxIcon) {.cdecl, 27 | importcpp: "SetIcon", header: wxh.} 28 | proc setTimeout*(this: var WxRichToolTip; milliseconds: cuint; 29 | millisecondsShowdelay: cuint = 0) {.cdecl, 30 | importcpp: "SetTimeout", header: wxh.} 31 | proc setTipKind*(this: var WxRichToolTip; tipKind: WxTipKind) {.cdecl, 32 | importcpp: "SetTipKind", header: wxh.} 33 | proc setTitleFont*(this: var WxRichToolTip; font: WxFont) {.cdecl, 34 | importcpp: "SetTitleFont", header: wxh.} 35 | proc showFor*(this: var WxRichToolTip; win: ptr WxWindow; rect: ptr WxRect = nil) {. 36 | cdecl, importcpp: "ShowFor", header: wxh.} 37 | proc destroywxRichToolTip*(this: var WxRichToolTip) {.cdecl, 38 | importcpp: "#.~wxRichToolTip()", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/scrolbar.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxScrollBarBase* {.importcpp: "wxScrollBarBase", header: wxh.} = object of WxControl 6 | 7 | 8 | proc constructwxScrollBarBase*(): WxScrollBarBase {.cdecl, constructor, 9 | importcpp: "wxScrollBarBase(@)", header: wxh.} 10 | proc getThumbPosition*(this: WxScrollBarBase): cint {.noSideEffect, cdecl, 11 | importcpp: "GetThumbPosition", header: wxh.} 12 | proc getThumbSize*(this: WxScrollBarBase): cint {.noSideEffect, cdecl, 13 | importcpp: "GetThumbSize", header: wxh.} 14 | proc getPageSize*(this: WxScrollBarBase): cint {.noSideEffect, cdecl, 15 | importcpp: "GetPageSize", header: wxh.} 16 | proc getRange*(this: WxScrollBarBase): cint {.noSideEffect, cdecl, 17 | importcpp: "GetRange", header: wxh.} 18 | proc isVertical*(this: WxScrollBarBase): bool {.noSideEffect, cdecl, 19 | importcpp: "IsVertical", header: wxh.} 20 | proc setThumbPosition*(this: var WxScrollBarBase; viewStart: cint) {.cdecl, 21 | importcpp: "SetThumbPosition", header: wxh.} 22 | proc setScrollbar*(this: var WxScrollBarBase; position: cint; thumbSize: cint; 23 | range: cint; pageSize: cint; refresh: bool = true) {.cdecl, 24 | importcpp: "SetScrollbar", header: wxh.} 25 | proc isNeeded*(this: WxScrollBarBase): bool {.noSideEffect, cdecl, 26 | importcpp: "IsNeeded", header: wxh.} 27 | -------------------------------------------------------------------------------- /wxnim/private/slider.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | const 4 | wxSL_HORIZONTAL* = wxHORIZONTAL 5 | wxSL_VERTICAL* = wxVERTICAL 6 | wxSL_TICKS* = 0x00000010 7 | wxSL_AUTOTICKS* = wxSL_TICKS 8 | wxSL_LEFT* = 0x00000040 9 | wxSL_TOP* = 0x00000080 10 | wxSL_RIGHT* = 0x00000100 11 | wxSL_BOTTOM* = 0x00000200 12 | wxSL_BOTH* = 0x00000400 13 | wxSL_SELRANGE* = 0x00000800 14 | wxSL_INVERSE* = 0x00001000 15 | wxSL_MIN_MAX_LABELS* = 0x00002000 16 | wxSL_VALUE_LABEL* = 0x00004000 17 | wxSL_LABELS* = (wxSL_MIN_MAX_LABELS or wxSL_VALUE_LABEL) 18 | 19 | 20 | type 21 | WxSlider* {.importcpp: "wxSlider", header: wxh.} = object of WxControl 22 | 23 | proc constructwxSlider*(): WxSlider {.cdecl, constructor, importcpp: "wxSlider(@)", 24 | header: wxh.} 25 | proc constructwxSlider*(parent: ptr WxWindow; id: WxWindowID; value: cint; 26 | minValue: cint; maxValue: cint; 27 | pos: WxPoint = wxDefaultPosition; 28 | size: WxSize = wxDefaultSize; style: clong = wxSL_HORIZONTAL; 29 | validator: WxValidator = wxDefaultValidator; 30 | name: WxString = "slider"): WxSlider {.cdecl, 31 | constructor, importcpp: "wxSlider(@)", header: wxh.} 32 | proc destroywxSlider*(this: var WxSlider) {.cdecl, importcpp: "#.~wxSlider()", 33 | header: wxh.} 34 | proc clearSel*(this: var WxSlider) {.cdecl, importcpp: "ClearSel", header: wxh.} 35 | proc clearTicks*(this: var WxSlider) {.cdecl, importcpp: "ClearTicks", header: wxh.} 36 | proc create*(this: var WxSlider; parent: ptr WxWindow; id: WxWindowID; value: cint; 37 | minValue: cint; maxValue: cint; point: WxPoint = wxDefaultPosition; 38 | size: WxSize = wxDefaultSize; style: clong = wxSL_HORIZONTAL; 39 | validator: WxValidator = wxDefaultValidator; 40 | name: WxString = "slider"): bool {.cdecl, importcpp: "Create", 41 | header: wxh.} 42 | proc getLineSize*(this: WxSlider): cint {.noSideEffect, cdecl, 43 | importcpp: "GetLineSize", header: wxh.} 44 | proc getMax*(this: WxSlider): cint {.noSideEffect, cdecl, importcpp: "GetMax", 45 | header: wxh.} 46 | proc getMin*(this: WxSlider): cint {.noSideEffect, cdecl, importcpp: "GetMin", 47 | header: wxh.} 48 | proc getPageSize*(this: WxSlider): cint {.noSideEffect, cdecl, 49 | importcpp: "GetPageSize", header: wxh.} 50 | proc getSelEnd*(this: WxSlider): cint {.noSideEffect, cdecl, importcpp: "GetSelEnd", 51 | header: wxh.} 52 | proc getSelStart*(this: WxSlider): cint {.noSideEffect, cdecl, 53 | importcpp: "GetSelStart", header: wxh.} 54 | proc getThumbLength*(this: WxSlider): cint {.noSideEffect, cdecl, 55 | importcpp: "GetThumbLength", header: wxh.} 56 | proc getTickFreq*(this: WxSlider): cint {.noSideEffect, cdecl, 57 | importcpp: "GetTickFreq", header: wxh.} 58 | proc getValue*(this: WxSlider): cint {.noSideEffect, cdecl, importcpp: "GetValue", 59 | header: wxh.} 60 | proc setLineSize*(this: var WxSlider; lineSize: cint) {.cdecl, 61 | importcpp: "SetLineSize", header: wxh.} 62 | proc setMin*(this: var WxSlider; minValue: cint) {.cdecl, importcpp: "SetMin", 63 | header: wxh.} 64 | proc setMax*(this: var WxSlider; maxValue: cint) {.cdecl, importcpp: "SetMax", 65 | header: wxh.} 66 | proc setPageSize*(this: var WxSlider; pageSize: cint) {.cdecl, 67 | importcpp: "SetPageSize", header: wxh.} 68 | proc setRange*(this: var WxSlider; minValue: cint; maxValue: cint) {.cdecl, 69 | importcpp: "SetRange", header: wxh.} 70 | proc setSelection*(this: var WxSlider; startPos: cint; endPos: cint) {.cdecl, 71 | importcpp: "SetSelection", header: wxh.} 72 | proc setThumbLength*(this: var WxSlider; len: cint) {.cdecl, 73 | importcpp: "SetThumbLength", header: wxh.} 74 | proc setTick*(this: var WxSlider; tickPos: cint) {.cdecl, importcpp: "SetTick", 75 | header: wxh.} 76 | proc setTickFreq*(this: var WxSlider; n: cint) {.cdecl, importcpp: "SetTickFreq", 77 | header: wxh.} 78 | proc setValue*(this: var WxSlider; value: cint) {.cdecl, importcpp: "SetValue", 79 | header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/statbmp.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | type 5 | WxStaticBitmap* {.importcpp: "wxStaticBitmap", header: wxh.} = object of WxStaticBitmapBase 6 | 7 | 8 | proc constructwxStaticBitmap*(): WxStaticBitmap {.cdecl, constructor, 9 | importcpp: "wxStaticBitmap(@)", header: wxh.} 10 | proc constructwxStaticBitmap*(parent: ptr WxWindow; id: WxWindowID; label: WxBitmap; 11 | pos: WxPoint = wxDefaultPosition; 12 | size: WxSize = wxDefaultSize; style: clong = 0; 13 | name: WxString = wxStaticBitmapNameStr): WxStaticBitmap {. 14 | cdecl, constructor, importcpp: "wxStaticBitmap(@)", header: wxh.} 15 | proc create*(this: var WxStaticBitmap; parent: ptr WxWindow; id: WxWindowID; 16 | label: WxBitmap; pos: WxPoint = wxDefaultPosition; 17 | size: WxSize = wxDefaultSize; style: clong = 0; 18 | name: WxString = wxStaticBitmapNameStr): bool {.cdecl, 19 | importcpp: "Create", header: wxh.} 20 | proc setIcon*(this: var WxStaticBitmap; icon: WxIcon) {.cdecl, importcpp: "SetIcon", 21 | header: wxh.} 22 | proc setBitmap*(this: var WxStaticBitmap; bitmap: WxBitmap) {.cdecl, 23 | importcpp: "SetBitmap", header: wxh.} 24 | proc getBitmap*(this: WxStaticBitmap): WxBitmap {.noSideEffect, cdecl, 25 | importcpp: "GetBitmap", header: wxh.} 26 | proc getIcon*(this: WxStaticBitmap): WxIcon {.noSideEffect, cdecl, 27 | importcpp: "GetIcon", header: wxh.} 28 | #proc getClassDefaultAttributes*(variant: WxWindowVariant = wxWINDOW_VARIANT_NORMAL): WxVisualAttributes {. 29 | # cdecl, importcpp: "wxStaticBitmap::GetClassDefaultAttributes(@)", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/statbmpbase.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | var wxStaticBitmapNameStr* {.importcpp: "wxStaticBitmapNameStr", header: wxh.}: WxString #ptr char 4 | 5 | 6 | type 7 | WxStaticBitmapBase* {.importcpp: "wxStaticBitmapBase", header: wxh.} = object of WxControl 8 | 9 | 10 | proc constructwxStaticBitmapBase*(): WxStaticBitmapBase {.cdecl, constructor, 11 | importcpp: "wxStaticBitmapBase(@)", header: wxh.} 12 | proc destroywxStaticBitmapBase*(this: var WxStaticBitmapBase) {.cdecl, 13 | importcpp: "#.~wxStaticBitmapBase()", header: wxh.} 14 | proc setIcon*(this: var WxStaticBitmapBase; icon: WxIcon) {.cdecl, 15 | importcpp: "SetIcon", header: wxh.} 16 | proc setBitmap*(this: var WxStaticBitmapBase; bitmap: WxBitmap) {.cdecl, 17 | importcpp: "SetBitmap", header: wxh.} 18 | proc getBitmap*(this: WxStaticBitmapBase): WxBitmap {.noSideEffect, cdecl, 19 | importcpp: "GetBitmap", header: wxh.} 20 | proc getIcon*(this: WxStaticBitmapBase): WxIcon {.noSideEffect, cdecl, 21 | importcpp: "GetIcon", header: wxh.} 22 | proc acceptsFocus*(this: WxStaticBitmapBase): bool {.noSideEffect, cdecl, 23 | importcpp: "AcceptsFocus", header: wxh.} 24 | proc hasTransparentBackground*(this: var WxStaticBitmapBase): bool {.cdecl, 25 | importcpp: "HasTransparentBackground", header: wxh.} 26 | -------------------------------------------------------------------------------- /wxnim/private/statbox.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxStaticBox* {.importcpp: "wxStaticBox", header: wxh.} = object of WxControl 5 | 6 | 7 | proc constructwxStaticBox*(): WxStaticBox {.cdecl, constructor, 8 | importcpp: "wxStaticBox(@)", header: wxh.} 9 | proc constructwxStaticBox*(parent: ptr WxWindow; id: WxWindowID; label: WxString; 10 | pos: WxPoint = wxDefaultPosition; 11 | size: WxSize = wxDefaultSize; style: clong = 0; 12 | name: WxString = "groupBox"): WxStaticBox {.cdecl, 13 | constructor, importcpp: "wxStaticBox(@)", header: wxh.} 14 | proc destroywxStaticBox*(this: var WxStaticBox) {.cdecl, 15 | importcpp: "#.~wxStaticBox()", header: wxh.} 16 | proc create*(this: var WxStaticBox; parent: ptr WxWindow; id: WxWindowID; 17 | label: WxString; pos: WxPoint = wxDefaultPosition; 18 | size: WxSize = wxDefaultSize; style: clong = 0; 19 | name: WxString = "groupBox"): bool {.cdecl, importcpp: "Create", 20 | header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/stattext.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxST_NO_AUTORESIZE* = 0x00000001 6 | 7 | 8 | const 9 | wxST_ELLIPSIZE_START* = 0x00000004 10 | wxST_ELLIPSIZE_MIDDLE* = 0x00000008 11 | wxST_ELLIPSIZE_END* = 0x00000010 12 | 13 | type 14 | WxStaticTextBase* {.importcpp: "wxStaticTextBase", header: wxh.} = object of WxControl 15 | 16 | 17 | proc constructwxStaticTextBase*(): WxStaticTextBase {.cdecl, constructor, 18 | importcpp: "wxStaticTextBase(@)", header: wxh.} 19 | proc wrap*(this: var WxStaticTextBase; width: cint) {.cdecl, importcpp: "Wrap", 20 | header: wxh.} 21 | proc acceptsFocus*(this: WxStaticTextBase): bool {.noSideEffect, cdecl, 22 | importcpp: "AcceptsFocus", header: wxh.} 23 | proc hasTransparentBackground*(this: var WxStaticTextBase): bool {.cdecl, 24 | importcpp: "HasTransparentBackground", header: wxh.} 25 | proc isEllipsized*(this: WxStaticTextBase): bool {.noSideEffect, cdecl, 26 | importcpp: "IsEllipsized", header: wxh.} 27 | type 28 | WxStaticText* {.importcpp: "wxStaticText", header: wxh.} = object of WxStaticTextBase 29 | 30 | 31 | proc constructwxStaticText*(): WxStaticText {.cdecl, constructor, 32 | importcpp: "wxStaticText(@)", header: wxh.} 33 | proc constructwxStaticText*(parent: ptr WxWindow; id: WxWindowID; 34 | label: WxString; pos: WxPoint = wxDefaultPosition; 35 | size: WxSize = wxDefaultSize; style: clong = 0; 36 | name: WxString = constructWxString("staticText")): WxStaticText {. 37 | cdecl, constructor, importcpp: "wxStaticText(@)", header: wxh.} 38 | proc create*(this: var WxStaticText; parent: ptr WxWindow; id: WxWindowID; 39 | label: WxString; pos: WxPoint = wxDefaultPosition; 40 | size: WxSize = wxDefaultSize; style: clong = 0; 41 | name: WxString = constructWxString("staticText")): bool {.cdecl, 42 | importcpp: "Create", header: wxh.} 43 | proc setLabel*(this: var WxStaticText; label: WxString) {.cdecl, 44 | importcpp: "SetLabel", header: wxh.} 45 | proc setFont*(this: var WxStaticText; font: WxFont): bool {.discardable, cdecl, 46 | importcpp: "SetFont", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/string.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | WxUniChar* {.importcpp: "wxUniChar", header: wxh.} = object 5 | 6 | WxCStrData* {.importcpp: "wxCStrData", header: wxh.} = object 7 | 8 | WxString* {.importcpp: "wxString", header: wxh.} = object 9 | 10 | 11 | proc constructwxString*(): WxString {.cdecl, constructor, 12 | importcpp: "wxString(@)", header: wxh.} 13 | proc constructwxString*(stringSrc: WxString): WxString {.cdecl, constructor, 14 | importcpp: "wxString(@)", header: wxh.} 15 | proc constructwxString*(psz: cstring; nLength: csize): WxString {.cdecl, 16 | constructor, importcpp: "wxString(@)", header: wxh.} 17 | proc clone*(this: WxString): WxString {.noSideEffect, cdecl, importcpp: "Clone", 18 | header: wxh.} 19 | proc length*(this: WxString): csize {.noSideEffect, cdecl, importcpp: "length", 20 | header: wxh.} 21 | proc empty*(this: WxString): bool {.noSideEffect, cdecl, importcpp: "empty", 22 | header: wxh.} 23 | proc substr*(this: WxString; nStart: csize = 0; nLen: csize): WxString {. 24 | noSideEffect, cdecl, importcpp: "substr", header: wxh.} 25 | proc len*(this: WxString): csize {.noSideEffect, cdecl, importcpp: "Len", 26 | header: wxh.} 27 | proc isEmpty*(this: WxString): bool {.noSideEffect, cdecl, importcpp: "IsEmpty", 28 | header: wxh.} 29 | proc truncate*(this: var WxString; uiLen: csize): var WxString {.cdecl, 30 | importcpp: "Truncate", header: wxh.} 31 | proc clear*(this: var WxString) {.cdecl, importcpp: "Clear", header: wxh.} 32 | proc isAscii*(this: WxString): bool {.noSideEffect, cdecl, importcpp: "IsAscii", 33 | header: wxh.} 34 | proc isNumber*(this: WxString): bool {.noSideEffect, cdecl, 35 | importcpp: "IsNumber", header: wxh.} 36 | proc isWord*(this: WxString): bool {.noSideEffect, cdecl, importcpp: "IsWord", 37 | header: wxh.} 38 | proc at*(this: WxString; n: csize): WxUniChar {.noSideEffect, cdecl, 39 | importcpp: "at", header: wxh.} 40 | proc getChar*(this: WxString; n: csize): WxUniChar {.noSideEffect, cdecl, 41 | importcpp: "GetChar", header: wxh.} 42 | proc setChar*(this: var WxString; n: csize; ch: WxUniChar) {.cdecl, 43 | importcpp: "SetChar", header: wxh.} 44 | proc last*(this: WxString): WxUniChar {.noSideEffect, cdecl, importcpp: "Last", 45 | header: wxh.} 46 | proc `[]`*(this: WxString; n: cint): WxUniChar {.noSideEffect, cdecl, 47 | importcpp: "#[@]", header: wxh.} 48 | proc cStr*(this: WxString): WxCStrData {.noSideEffect, cdecl, 49 | importcpp: "c_str", header: wxh.} 50 | proc data*(this: WxString): WxCStrData {.noSideEffect, cdecl, importcpp: "data", 51 | header: wxh.} 52 | proc getData*(this: WxString): WxCStrData {.noSideEffect, cdecl, 53 | importcpp: "GetData", header: wxh.} 54 | proc fromAscii*(ascii: ptr cuchar): WxString {.cdecl, 55 | importcpp: "wxString::FromAscii(@)", header: wxh.} 56 | proc fromAscii*(ascii: ptr cuchar; len: csize): WxString {.cdecl, 57 | importcpp: "wxString::FromAscii(@)", header: wxh.} 58 | proc fromUTF8Unchecked*(utf8: cstring): WxString {.cdecl, 59 | importcpp: "wxString::FromUTF8Unchecked(@)", header: wxh.} 60 | proc fromUTF8Unchecked*(utf8: cstring; len: csize): WxString {.cdecl, 61 | importcpp: "wxString::FromUTF8Unchecked(@)", header: wxh.} 62 | proc fromUTF8*(utf8: cstring): WxString {.cdecl, 63 | importcpp: "wxString::FromUTF8(@)", header: wxh.} 64 | proc fromUTF8*(utf8: cstring; len: csize): WxString {.cdecl, 65 | importcpp: "wxString::FromUTF8(@)", header: wxh.} 66 | proc utf8Length*(this: WxString): csize {.noSideEffect, cdecl, 67 | importcpp: "utf8_length", header: wxh.} 68 | proc from8BitData*(data: cstring; len: csize): WxString {.cdecl, 69 | importcpp: "wxString::From8BitData(@)", header: wxh.} 70 | proc from8BitData*(data: cstring): WxString {.cdecl, 71 | importcpp: "wxString::From8BitData(@)", header: wxh.} 72 | 73 | proc asCString*(this: WxCStrData): cstring {.noSideEffect, cdecl, 74 | importcpp: "AsChar", header: wxh.} 75 | 76 | proc mb_str*(this: WxString): cstring {.noSideEffect, cdecl, 77 | importcpp: "mb_str", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/tglbtn.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | var wxEVT_TOGGLEBUTTON* {.importcpp: "wxEVT_TOGGLEBUTTON", header: wxh.}: WxEventType 4 | 5 | 6 | type 7 | WxToggleButton* {.importcpp: "wxToggleButton", header: wxh.} = object of WxAnyButton 8 | 9 | 10 | proc constructwxToggleButton*(): WxToggleButton {.cdecl, constructor, 11 | importcpp: "wxToggleButton(@)", header: wxh.} 12 | proc constructwxToggleButton*(parent: ptr WxWindow; id: WxWindowID; label: WxString; 13 | pos: WxPoint = wxDefaultPosition; 14 | size: WxSize = wxDefaultSize; style: clong = 0; 15 | val: WxValidator = wxDefaultValidator; 16 | name: WxString = constructWxString("checkbox")): WxToggleButton {. 17 | cdecl, constructor, importcpp: "wxToggleButton(@)", header: wxh.} 18 | proc destroywxToggleButton*(this: var WxToggleButton) {.cdecl, 19 | importcpp: "#.~wxToggleButton()", header: wxh.} 20 | proc create*(this: var WxToggleButton; parent: ptr WxWindow; id: WxWindowID; 21 | label: WxString; pos: WxPoint = wxDefaultPosition; 22 | size: WxSize = wxDefaultSize; style: clong = 0; 23 | val: WxValidator = wxDefaultValidator; 24 | name: WxString = constructWxString("checkbox")): bool {.cdecl, 25 | importcpp: "Create", header: wxh.} 26 | proc getValue*(this: WxToggleButton): bool {.noSideEffect, cdecl, 27 | importcpp: "GetValue", header: wxh.} 28 | proc setValue*(this: var WxToggleButton; state: bool) {.cdecl, importcpp: "SetValue", 29 | header: wxh.} 30 | 31 | type 32 | WxBitmapToggleButton* {.importcpp: "wxBitmapToggleButton", header: wxh.} = object of WxToggleButton 33 | 34 | 35 | proc constructwxBitmapToggleButton*(): WxBitmapToggleButton {.cdecl, constructor, 36 | importcpp: "wxBitmapToggleButton(@)", header: wxh.} 37 | proc constructwxBitmapToggleButton*(parent: ptr WxWindow; id: WxWindowID; 38 | label: WxBitmap; 39 | pos: WxPoint = wxDefaultPosition; 40 | size: WxSize = wxDefaultSize; style: clong = 0; 41 | val: WxValidator = wxDefaultValidator; name: WxString = constructWxString( 42 | "checkbox")): WxBitmapToggleButton {.cdecl, constructor, 43 | importcpp: "wxBitmapToggleButton(@)", 44 | header: wxh.} 45 | proc create*(this: var WxBitmapToggleButton; parent: ptr WxWindow; id: WxWindowID; 46 | label: WxBitmap; pos: WxPoint = wxDefaultPosition; 47 | size: WxSize = wxDefaultSize; style: clong = 0; 48 | val: WxValidator = wxDefaultValidator; 49 | name: WxString = constructWxString("checkbox")): bool {.cdecl, 50 | importcpp: "Create", header: wxh.} 51 | proc getValue*(this: WxBitmapToggleButton): bool {.noSideEffect, cdecl, 52 | importcpp: "GetValue", header: wxh.} 53 | proc setValue*(this: var WxBitmapToggleButton; state: bool) {.cdecl, 54 | importcpp: "SetValue", header: wxh.} -------------------------------------------------------------------------------- /wxnim/private/types.nim: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const 5 | wxTYPE_ANY* = 0 6 | wxTYPE_OBJECT* = wxTYPE_ANY 7 | wxTYPE_WINDOW* = 1 8 | wxTYPE_DIALOG_BOX* = 2 9 | wxTYPE_ITEM* = 3 10 | wxTYPE_PANEL* = 4 11 | wxTYPE_CANVAS* = 5 12 | wxTYPE_TEXT_WINDOW* = 6 13 | wxTYPE_FRAME* = 7 14 | wxTYPE_BUTTON* = 8 15 | wxTYPE_TEXT* = 9 16 | wxTYPE_MESSAGE* = 10 17 | wxTYPE_CHOICE* = 11 18 | wxTYPE_LIST_BOX* = 12 19 | wxTYPE_SLIDER* = 13 20 | wxTYPE_CHECK_BOX* = 14 21 | wxTYPE_MENU* = 15 22 | wxTYPE_MENU_BAR* = 16 23 | wxTYPE_MULTI_TEXT* = 17 24 | wxTYPE_RADIO_BOX* = 18 25 | wxTYPE_GROUP_BOX* = 19 26 | wxTYPE_GAUGE* = 20 27 | wxTYPE_SCROLL_BAR* = 21 28 | wxTYPE_VIRT_LIST_BOX* = 22 29 | wxTYPE_COMBO_BOX* = 23 30 | wxTYPE_RADIO_BUTTON* = 24 31 | wxTYPE_EVENT* = 25 32 | wxTYPE_DC* = 26 33 | wxTYPE_DC_CANVAS* = 27 34 | wxTYPE_DC_POSTSCRIPT* = 28 35 | wxTYPE_DC_PRINTER* = 29 36 | wxTYPE_DC_METAFILE* = 30 37 | wxTYPE_DC_MEMORY* = 31 38 | wxTYPE_MOUSE_EVENT* = 32 39 | wxTYPE_KEY_EVENT* = 33 40 | wxTYPE_COMMAND_EVENT* = 34 41 | wxTYPE_DC_PANEL* = 35 42 | wxTYPE_PEN* = 40 43 | wxTYPE_BRUSH* = 41 44 | wxTYPE_FONT* = 42 45 | wxTYPE_ICON* = 42 46 | wxTYPE_BITMAP* = 43 47 | wxTYPE_METAFILE* = 44 48 | wxTYPE_TIMER* = 45 49 | wxTYPE_COLOUR* = 46 50 | wxTYPE_COLOURMAP* = 47 51 | wxTYPE_CURSOR* = 48 52 | wxTYPE_DDE_CLIENT* = 60 53 | wxTYPE_DDE_SERVER* = 61 54 | wxTYPE_DDE_CONNECTION* = 62 55 | wxTYPE_HELP_INSTANCE* = 63 56 | wxTYPE_LIST* = 70 57 | wxTYPE_STRING_LIST* = 71 58 | wxTYPE_HASH_TABLE* = 72 59 | wxTYPE_NODE* = 73 60 | wxTYPE_APP* = 74 61 | wxTYPE_DATE* = 75 62 | wxTYPE_ENHANCED_DIALOG* = 80 63 | wxTYPE_TOOLBAR* = 81 64 | wxTYPE_BUTTONBAR* = 82 65 | wxTYPE_DATABASE* = 90 66 | wxTYPE_QUERY_FIELD* = 91 67 | wxTYPE_QUERY_COL* = 92 68 | wxTYPE_RECORDSET* = 93 69 | wxTYPE_USER* = 500 70 | 71 | -------------------------------------------------------------------------------- /wxnim/richtext.nim: -------------------------------------------------------------------------------- 1 | 2 | import wx 3 | 4 | {.experimental: "codeReordering".} 5 | 6 | include private/richtext/richtextdialogpage 7 | include private/richtext/richtextbuffer 8 | include private/richtext/richtextbulletspage 9 | include private/richtext/richtextctrl 10 | include private/richtext/richtextbackgroundpage 11 | include private/richtext/richtextborderspage 12 | 13 | include private/richtext/richtextfontpage 14 | include private/richtext/richtextformatdlg 15 | include private/richtext/richtexthtml 16 | include private/richtext/richtextimagedlg 17 | include private/richtext/richtextindentspage 18 | include private/richtext/richtextliststylepage 19 | include private/richtext/richtextmarginspage 20 | include private/richtext/richtextprint 21 | include private/richtext/richtextsizepage 22 | include private/richtext/richtextstyledlg 23 | include private/richtext/richtextstylepage 24 | include private/richtext/richtextstyles 25 | include private/richtext/richtextsymboldlg 26 | include private/richtext/richtexttabspage 27 | include private/richtext/richtextuicustomization 28 | include private/richtext/richtextxml 29 | -------------------------------------------------------------------------------- /wxnim/wx.nim: -------------------------------------------------------------------------------- 1 | # wx wrapper for Nim 2 | # See LICENSE.txt for details of the license. 3 | 4 | # Andreas Rumpf 2015 5 | 6 | include wxCompile 7 | include driver 8 | 9 | const 10 | wxh* = """#include 11 | #ifndef WX_PRECOMP 12 | #include 13 | #endif""" 14 | 15 | {.experimental: "codeReordering".} 16 | 17 | include "private/object" 18 | include private/string 19 | 20 | converter implicitDeref*[T](p: ptr T): var T = p[] 21 | 22 | converter implicitDeref*(p: ptr WxFrame): var WxWindowBase = p[] 23 | 24 | converter toWxString*(s: string): WxString = 25 | result = constructWxString(cstring(s), s.len) 26 | 27 | converter wxOrientationToClong*(inType:WxOrientation): clong = cast[clong](inType) 28 | 29 | converter wxStretchToCint*(inType:WxStretch): cint = cast[cint](inType) 30 | 31 | converter wxAlignmentToCint*(inType:WxAlignment): cint = cast[cint](inType) 32 | 33 | converter wxDirectionToCint*(inType:WxDirection): cint = cast[cint](inType) 34 | 35 | 36 | include private/arrstr 37 | 38 | converter stringArrayToWxStringArray*(inType: seq[string]): WxArrayString = 39 | result = constructWxArrayString() 40 | for str in inType: 41 | result.add(str) 42 | 43 | include private/colour 44 | include private/fontenc 45 | include private/defs 46 | 47 | const 48 | fileWildcard* = when defined(windows): "*.*" else: "*" 49 | 50 | include private/list 51 | include private/gdicmn 52 | include private/font 53 | include private/fontdata 54 | include private/fontenum 55 | 56 | include private/image 57 | include private/bitmap 58 | 59 | include private/icon 60 | include private/intl 61 | 62 | type 63 | WxClientDataType* {.importcpp: "wxClientDataType", header: "".} = object of WxObject 64 | 65 | const isForward = 1 66 | 67 | include private/event 68 | include private/window 69 | include private/layout 70 | 71 | include private/aboutdlg 72 | 73 | include private/any 74 | include private/control 75 | include private/anybutton 76 | include private/app 77 | include private/bannerwindow 78 | include private/button 79 | include private/bmpbuttn 80 | 81 | include private/calctrl 82 | include private/checkbox 83 | include private/listbox 84 | 85 | include private/checklst 86 | include private/choice 87 | include private/colordlg 88 | include private/combo 89 | include private/combobox 90 | include private/commandlinkbutton 91 | include private/dataobj 92 | include private/dataview 93 | include private/datetimectrl 94 | include private/datectrl 95 | include private/dialog 96 | include private/dirdlg 97 | include private/filedlg 98 | include private/fontdlg 99 | include private/fontpicker 100 | include private/frame 101 | include private/gauge 102 | include private/hyperlink 103 | include private/kbdstate 104 | include private/listbook 105 | include private/listctrl 106 | include private/menu 107 | include private/menuitem 108 | #include private/notebook 109 | include private/ownerdrw 110 | include private/panel 111 | include private/position 112 | include private/radiobox 113 | include private/radiobut 114 | include private/sizer 115 | include private/slider 116 | include private/spinbutt 117 | include private/spinctrl 118 | include private/statusbar 119 | include private/textctrl 120 | include private/toolbar 121 | include private/treectrl 122 | include private/types 123 | include private/variant 124 | include private/webview 125 | include private/stattext 126 | include private/statbox 127 | include private/tglbtn 128 | include private/statbmpbase 129 | include private/statbmp 130 | 131 | include private/scrolwin 132 | 133 | 134 | proc cnew*[T](x: T): ptr T {.importcpp: "(new @)", nodecl.} 135 | 136 | converter toEventType*[T](x: WxEventTypeTag[T]): WxEventType {. 137 | importcpp: "#", header: "".} 138 | 139 | when false: 140 | proc registerEventCallback(attachedTo: int; 141 | callback: proc (x: WxEvent) {.closure.}) = 142 | {.emit: """ 143 | wxTheApp->Bind(); 144 | """.} 145 | 146 | --------------------------------------------------------------------------------