From dmiceman at ubiz.ru Mon May 2 04:50:00 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Mon May 2 04:46:03 2005 Subject: [Wxruby-users] wxRuby Roadmap, Schedule and wxWidgets 2.6.0 In-Reply-To: References: Message-ID: <1254015138.20050502175000@ubiz.ru> Hello, DJB. You wrote 30.04.2005, 17:35:01: D> I'm very interested in migrating some apps to ruby and wxRuby. D> Is there a rough estimate of when wxRuby will support wxWidgets 2.6.0? D> Are there specific tasks that require volunteers? That is depend on which wxruby variant you plan to use. I`m not yet looked at wxruby-swig, may be it can be used with wxwidgets 2.6 without modification, but for plain wxruby you can use this patch: http://rubyforge.org/pipermail/wxruby-users/attachments/20050428/e7a0bc63/wxwidgets-2.6-2.obj (it is posted just before your email, may be you don`t seen it :-). You still need to edit extconf.rb to reflect your needs, but i believe what this patch will allow you to build working wxruby. -- Dmitry mailto:dmiceman@ubiz.ru From dmiceman at ubiz.ru Mon May 2 12:03:22 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Mon May 2 12:02:28 2005 Subject: [Wxruby-users] where is destructors? Message-ID: <1495699715.20050503010322@ubiz.ru> Hello, wxruby-users. I`m noticed huge GDI resources leakage when working with my programs (on windows). Fortunately, i simple fix this by calling 'delete' on wxBitmap object (patch bellow). But i`m wondering -- why there are no calls to destructors of wrapped wxwidgets objects in wxruby? Is there some problems? This is a patch: ================================================================ --- src/bitmap.cpp 30 Nov 2003 22:54:48 -0000 1.2 +++ src/bitmap.cpp 2 May 2005 11:11:58 -0000 @@ -32,10 +32,16 @@ rb_define_method(rubyClass, "convert_to_image", VALUEFUNC(WxBitmap::ConvertToImage), 0); } +void WxBitmap_free(wxBitmap *bmp) { + if(bmp) { + delete bmp; + }; +}; + VALUE WxBitmap::alloc(VALUE self) { - return Data_Wrap_Struct(self, 0, 0, 0); + return Data_Wrap_Struct(self, 0, WxBitmap_free, 0); } VALUE ================================================================ -- Dmitry mailto:dmiceman@ubiz.ru From dmiceman at ubiz.ru Mon May 2 12:17:57 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Mon May 2 12:12:06 2005 Subject: [Wxruby-users] Wx::StringInputBuffer/Wx::StringOutputBuffer Message-ID: <110128590.20050503011757@ubiz.ru> Hello, wxruby-users. This is two files which wrap wxStringInputStream and wxStringOutputStream for ruby. I need this to implement in-memory image io. 'stringio.rbw' -- small sample for it. Short usage: stream = Wx::StringInputStream.new image_data image = Wx::Image.new stream stream = Wx::StringOutputStream.new image.save_file stream, 'image/jpeg' image_data = stream.get_string Installation: just place 'sstream.cpp' and 'sstream.in' in 'src' and add 'sstream.o' to $objs variable in 'src/extconf.rb'. -- Dmitry mailto:dmiceman@ubiz.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: sstream.h Type: application/octet-stream Size: 786 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050503/33925ed5/sstream.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: sstream.cpp Type: application/octet-stream Size: 3699 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050503/33925ed5/sstream-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: stringio.rbw Type: application/octet-stream Size: 1820 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050503/33925ed5/stringio.obj From wxruby at qualitycode.com Mon May 2 19:40:04 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon May 2 19:34:04 2005 Subject: [Wxruby-users] where is destructors? In-Reply-To: <1495699715.20050503010322@ubiz.ru> References: <1495699715.20050503010322@ubiz.ru> Message-ID: <4276BA54.8030501@qualitycode.com> Dmitry Morozhnikov wrote: > Hello, wxruby-users. > > I`m noticed huge GDI resources leakage when working with my programs > (on windows). Fortunately, i simple fix this by calling 'delete' on > wxBitmap object (patch bellow). But i`m wondering -- why there are no > calls to destructors of wrapped wxwidgets objects in wxruby? Is there > some problems? This is a known problem with wxruby, and the plan has been to fix it by moving to wxruby-swig. Memory handling in a C++ wrapper library like wxruby is challenging. Sometimes the C++ system initiates the object creation, and a ruby object merely wraps it. Other times, the ruby object is created, causing the underlying C++ object to be created. Similarly, sometimes C++ initiates an object destruction, while other times it is initiated by Ruby. Sometimes the Ruby object goes away while the C++ object continues to exist. It's all quite complex, and the current philosophy is that it is better to leak than to crash due to double-frees. SWIG automatically handles many of these cases. For those that it does not handle, it provides tools that allow you to write the memory management just once, and it can be applied to all the classes with no extra effort. Contrast that with current/old wxruby 0.6, where the memory handling must first be invented, and then applied to each individual class, manually. In fact, this is one of the most compelling reasons to shift to SWIG. Another big one is SWIG's "directors", which make it super easy to support ruby methods overriding virtual C++ methods. Kevin From usrlocalinfo at yahoo.com Tue May 3 07:59:41 2005 From: usrlocalinfo at yahoo.com (DJB) Date: Tue May 3 07:55:08 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? Message-ID: If wxRuby-SWIG is as usable as wxRuby 0.6.0, maybe it should be given a version number and packaged up for download. Given the nature of SWIG, having a lot more people use it would probably result in more code contributions to this project. Seems most of the changes are 2+ months old, so I'm guessing wxRuby-SWIG is fairly stable right now in terms of frequency of changes... From alex at pressure.to Tue May 3 08:16:49 2005 From: alex at pressure.to (Alex Fenton) Date: Tue May 3 08:10:41 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: References: Message-ID: <42776BB1.6070305@pressure.to> DJB wrote: > If wxRuby-SWIG is as usable as wxRuby 0.6.0, maybe it should be given > a version number and packaged up for download. Unfortunately wxruby-swig isn't yet as usable as wxruby-0.6.0 - it currently supports fewer methods and classes. There was a discussion on this list recently of version, for which see: http://rubyforge.org/pipermail/wxruby-users/2005-February/001140.html Still, neither of these prevents wxruby-swig being packaged and offered for download rather than having it available only via anon CVS. > Given the nature of SWIG, having a lot more people use it would > probably result in more code contributions to this project. It would be great to see wxruby-swig move forward, but from experience I have to say that even with SWIG, a fair amount of C/C++ knowledge is needed to contribute classes. > Seems most of the changes are 2+ months old, so I'm guessing > wxRuby-SWIG is fairly stable right now in terms of frequency of changes... I think several of the wxruby developers have been heavily weighed down with other commitments in the past few months, and so have not been able to work on wxruby as much. I think the CVS history reflects this rather than wxruby-swig's stability. cheers alex From wxruby at qualitycode.com Tue May 3 08:52:11 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue May 3 08:46:16 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <42776BB1.6070305@pressure.to> References: <42776BB1.6070305@pressure.to> Message-ID: <427773FB.6090000@qualitycode.com> Alex Fenton wrote: > Unfortunately wxruby-swig isn't yet as usable as wxruby-0.6.0 - it > currently supports fewer methods and classes. True. > Still, neither of these prevents wxruby-swig being packaged and offered > for download rather than having it available only via anon CVS. > >> Given the nature of SWIG, having a lot more people use it would >> probably result in more code contributions to this project. Agreed. > It would be great to see wxruby-swig move forward, but from experience I > have to say that even with SWIG, a fair amount of C/C++ knowledge is > needed to contribute classes. I'm not sure about that. The majority of clases simply need to be added to the list. A bug in swig-ruby forces the disabling of some constructors (unless it has recently been fixed), and a few other methods need to be disabled for various reasons, until a C++ programmer can get them working. I guess I'm saying that someone who knows nothing about C++ could add quite a bit of functionality to wxruby-swig, leaving the hard parts for a C++ person to finish up. The other very time-consuming part of adding classes is that we also want samples added at the same time. If you don't have samples, it's hard to know that the classes have really been added and are really working. An alternative to samples would be unit tests, but those are harder with a GUI system like wx (I tried once, and wasn't happy with the results). > I think several of the wxruby developers have been heavily weighed down > with other commitments in the past few months, and so have not been able > to work on wxruby as much. I think the CVS history reflects this rather > than wxruby-swig's stability. True. Kevin From dmiceman at ubiz.ru Tue May 3 11:23:09 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Tue May 3 11:17:44 2005 Subject: [Wxruby-users] where is destructors? In-Reply-To: <4276BA54.8030501@qualitycode.com> References: <1495699715.20050503010322@ubiz.ru> <4276BA54.8030501@qualitycode.com> Message-ID: <1296450182.20050504002309@ubiz.ru> Hello, Kevin. You wrote 03.05.2005, 8:40:04: KS> This is a known problem with wxruby, and the plan has been to fix it by KS> moving to wxruby-swig. KS> Memory handling in a C++ wrapper library like wxruby is challenging. KS> Sometimes the C++ system initiates the object creation, and a ruby KS> object merely wraps it. Other times, the ruby object is created, causing KS> the underlying C++ object to be created. KS> Similarly, sometimes C++ initiates an object destruction, while other KS> times it is initiated by Ruby. Sometimes the Ruby object goes away while KS> the C++ object continues to exist. It's all quite complex, and the KS> current philosophy is that it is better to leak than to crash due to KS> double-frees. Well.. I think it is still possible to implement calls to proper destructors with plain wxruby. I see no problems for at least wxBitmap. On the other side, recently i run into nightmare with Wx::Window.get_update_region with current wxruby code (something goes wrong with wxRegion, but i have not yet check this). KS> In fact, this is one of the most compelling reasons to shift to SWIG. KS> Another big one is SWIG's "directors", which make it super easy to KS> support ruby methods overriding virtual C++ methods. :-) You convict me to look at swig again. Especially after today fighting with wxpp.rb, when i`m tried to implement correct wrapper for wxHtmlWindow::OnLinkClicked. -- Dmitry mailto:dmiceman@ubiz.ru From dmiceman at ubiz.ru Tue May 3 11:47:55 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Tue May 3 11:43:07 2005 Subject: [Wxruby-users] Wx::HtmlWindow.on_link_clicked Message-ID: <02859667.20050504004755@ubiz.ru> Hello, wxruby-users. This is an addition which implement wrapper for overloading wxHtmlWindow::OnLinkClicked method. Unfortunately, it was impossible to make it correctly without ugly hack to wxpp.rb, but i`m hope it does not broke it. Please look at attachment for a patch for htmlwindow.t and wxpp.rb and additional file htmllinkinfo.t (need to be added to $objs array in extconf.rb). Sample code of fancy about dialog for windows (for windows -- because of using function from shell32.dll to call favorite email client and favorite browser): ===================================================== require 'Win32API' require 'wxruby' class WrappedHtml < Wx::HtmlWindow def initialize(*args) super @shell = Win32API.new('shell32', 'ShellExecute', 'LPPPPI', 'L') end def on_link_clicked(link) @shell.call 0, 'open', link.get_href, nil, nil, 1 end end class App < Wx::App def on_init dialog = Wx::Dialog.new nil, -1, 'About' sizer = Wx::BoxSizer.new Wx::VERTICAL dialog.set_sizer sizer html = WrappedHtml.new dialog, -1 html.set_page < My wife web project
mail me
EOF sizer.add html, 1, Wx::EXPAND dialog.set_size Wx::Size.new(400, 300) dialog.center_on_screen Wx::BOTH dialog.show true dialog.evt_close do exit_main_loop end end end app = App.new app.main_loop ===================================================== -- Dmitry mailto:dmiceman@ubiz.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: OnLinkClicked.patch Type: application/octet-stream Size: 6772 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050504/07af1894/OnLinkClicked.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: htmllinkinfo.t Type: application/octet-stream Size: 716 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050504/07af1894/htmllinkinfo.obj From alex at pressure.to Tue May 3 12:46:16 2005 From: alex at pressure.to (Alex Fenton) Date: Tue May 3 12:47:22 2005 Subject: [Wxruby-users] new wxruby-swig class: TreeCtrl.i In-Reply-To: <427773FB.6090000@qualitycode.com> References: <42776BB1.6070305@pressure.to> <427773FB.6090000@qualitycode.com> Message-ID: <4277AAD8.4060406@pressure.to> Kevin Smith wrote: >I guess I'm saying that someone who knows nothing about C++ could add >quite a bit of functionality to wxruby-swig, leaving the hard parts for >a C++ person to finish up. > > You inspired me to have yet another go at getting swig to do something useful with wxruby. Not sure why, but finally enough bits connected. The main bit I was missing was how to find the method signature for an %ignore directive. Anyway, after a bit of tweaking and poking I got a basic TreeCtrl to compile (OS X, wX 2.5.2) and run. See attached files - if they look all right could someone commit for me please? >The other very time-consuming part of adding classes is that we also >want samples added at the same time. If you don't have samples, it's >hard to know that the classes have really been added and are really >working. > Just to notef for those new to developing on wxruby-swig, the range of samples provided with "old" wxruby is somewhat larger. These sample files might be useful for testing your wxruby-swig developments. cheers Alex -------------- next part -------------- # Copyright 2004 by Kevin Smith # released under the wxWidgets license # as part of the wxRuby project %module(directors="1") wxRubyConstants %include "common.i" %{ #include #include #include // // All of these exist on only one platform, so in those // cases I'm defining them so the compiler doesn't freak out // #ifndef __WXGTK__ #define wxCURSOR_DEFAULT 0 #endif #ifndef __WXMAC__ #define wxCURSOR_COPY_ARROW 0 #endif #ifndef __X__ // Not yet implemented for Windows #define wxCURSOR_CROSS_REVERSE 0 #define wxCURSOR_DOUBLE_ARROW 0 #define wxCURSOR_BASED_ARROW_UP 0 #define wxCURSOR_BASED_ARROW_DOWN 0 #endif // X11 %} enum { wxUNKNOWN_PLATFORM, wxCURSES, // Text-only CURSES wxXVIEW_X, // Sun's XView OpenLOOK toolkit wxMOTIF_X, // OSF Motif 1.x.x wxCOSE_X, // OSF Common Desktop Environment wxNEXTSTEP, // NeXTStep wxMAC, // Apple Mac OS 8/9/X with Mac paths wxMAC_DARWIN, // Apple Mac OS X with Unix paths wxBEOS, // BeOS wxGTK, // GTK on X wxGTK_WIN32, // GTK on Win32 wxGTK_OS2, // GTK on OS/2 wxGTK_BEOS, // GTK on BeOS wxGEOS, // GEOS wxOS2_PM, // OS/2 Workplace wxWINDOWS, // Windows or WfW wxMICROWINDOWS, // MicroWindows wxPENWINDOWS, // Windows for Pen Computing wxWINDOWS_NT, // Windows NT wxWIN32S, // Windows 32S API wxWIN95, // Windows 95 wxWIN386, // Watcom 32-bit supervisor modus wxMGL_UNIX, // MGL with direct hardware access wxMGL_X, // MGL on X wxMGL_WIN32, // MGL on Win32 wxMGL_OS2, // MGL on OS/2 wxMGL_DOS, // MGL on MS-DOS wxWINDOWS_OS2, // Native OS/2 PM wxUNIX, // wxBase under Unix wxX11 // Plain X11 and Universal widgets }; // ---------------------------------------------------------------------------- // Geometric flags // ---------------------------------------------------------------------------- enum wxGeometryCentre { wxCENTRE = 0x0001, wxCENTER = wxCENTRE }; // centering into frame rather than screen (obsolete) #define wxCENTER_FRAME 0x0000 // centre on screen rather than parent #define wxCENTRE_ON_SCREEN 0x0002 // wxCENTER_ON_SCREEN wxCENTRE_ON_SCREEN enum wxOrientation { wxHORIZONTAL = 0x0004, wxVERTICAL = 0x0008, wxBOTH = (wxVERTICAL | wxHORIZONTAL) }; enum wxDirection { wxRIGHT = 0x0020, wxUP = 0x0040, wxDOWN = 0x0080, wxTOP = wxUP, wxBOTTOM = wxDOWN, wxNORTH = wxUP, wxSOUTH = wxDOWN, wxWEST = wxLEFT, wxEAST = wxRIGHT, wxALL = (wxUP | wxDOWN | wxRIGHT | wxLEFT) }; enum wxAlignment { wxALIGN_NOT = 0x0000, wxALIGN_CENTER_HORIZONTAL = 0x0100, wxALIGN_CENTRE_HORIZONTAL = wxALIGN_CENTER_HORIZONTAL, wxALIGN_LEFT = wxALIGN_NOT, wxALIGN_TOP = wxALIGN_NOT, wxALIGN_RIGHT = 0x0200, wxALIGN_BOTTOM = 0x0400, wxALIGN_CENTER_VERTICAL = 0x0800, wxALIGN_CENTRE_VERTICAL = wxALIGN_CENTER_VERTICAL, wxALIGN_CENTER = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL), wxALIGN_CENTRE = wxALIGN_CENTER, // a mask to extract alignment from the combination of flags wxALIGN_MASK = 0x0f00 }; enum wxStretch { wxSTRETCH_NOT = 0x0000, wxSHRINK = 0x1000, wxGROW = 0x2000, wxEXPAND = wxGROW, wxSHAPED = 0x4000, wxADJUST_MINSIZE = 0x8000, wxTILE = 0xc000 }; // border flags: the values are chosen for backwards compatibility enum wxBorder { // this is different from wxBORDER_NONE as by default the controls do have // border wxBORDER_DEFAULT = 0, wxBORDER_NONE = 0x00200000, wxBORDER_STATIC = 0x01000000, wxBORDER_SIMPLE = 0x02000000, wxBORDER_RAISED = 0x04000000, wxBORDER_SUNKEN = 0x08000000, wxBORDER_DOUBLE = 0x10000000, // a mask to extract border style from the combination of flags wxBORDER_MASK = 0x1f200000 }; enum { wxOPEN = 0x0001, wxSAVE = 0x0002, wxOVERWRITE_PROMPT = 0x0004, wxHIDE_READONLY = 0x0008, wxFILE_MUST_EXIST = 0x0010, wxMULTIPLE = 0x0020, wxCHANGE_DIR = 0x0040 }; enum wxFindReplaceDialogStyles { // replace dialog (otherwise find dialog) wxFR_REPLACEDIALOG = 1, // don't allow changing the search direction wxFR_NOUPDOWN = 2, // don't allow case sensitive searching wxFR_NOMATCHCASE = 4, // don't allow whole word searching wxFR_NOWHOLEWORD = 8 }; // ---------------------------------------------------------------------------- // Window style flags // ---------------------------------------------------------------------------- /* * Values are chosen so they can be |'ed in a bit list. * Some styles are used across more than one group, * so the values mustn't clash with others in the group. * Otherwise, numbers can be reused across groups. * * From version 1.66: * Window (cross-group) styles now take up the first half * of the flag, and control-specific styles the * second half. * */ /* * Window (Frame/dialog/subwindow/panel item) style flags */ #define wxVSCROLL 0x80000000 #define wxHSCROLL 0x40000000 #define wxCAPTION 0x20000000 /* // New styles (border styles are now in their own enum) #define wxDOUBLE_BORDER wxBORDER_DOUBLE #define wxSUNKEN_BORDER wxBORDER_SUNKEN #define wxRAISED_BORDER wxBORDER_RAISED #define wxBORDER wxBORDER_SIMPLE #define wxSIMPLE_BORDER wxBORDER_SIMPLE #define wxSTATIC_BORDER wxBORDER_STATIC #define wxNO_BORDER wxBORDER_NONE */ // Override CTL3D etc. control colour processing to allow own background // colour. // Override CTL3D or native 3D styles for children #define wxNO_3D 0x00800000 // OBSOLETE - use wxNO_3D instead #define wxUSER_COLOURS wxNO_3D // wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, // disable it - but still show (see also wxLB_ALWAYS_SB style) // // NB: as this style is only supported by wxUniversal so far as it doesn't use // wxUSER_COLOURS/wxNO_3D, we reuse the same style value #define wxALWAYS_SHOW_SB 0x00800000 // Clip children when painting, which reduces flicker in e.g. frames and // splitter windows, but can't be used in a panel where a static box must be // 'transparent' (panel paints the background for it) #define wxCLIP_CHILDREN 0x00400000 // Note we're reusing the wxCAPTION style because we won't need captions // for subwindows/controls #define wxCLIP_SIBLINGS 0x20000000 #define wxTRANSPARENT_WINDOW 0x00100000 // Add this style to a panel to get tab traversal working outside of dialogs // (on by default for wxPanel, wxDialog, wxScrolledWindow) #define wxTAB_TRAVERSAL 0x00080000 // Add this style if the control wants to get all keyboard messages (under // Windows, it won't normally get the dialog navigation key events) #define wxWANTS_CHARS 0x00040000 // Make window retained (mostly Motif, I think) -- obsolete (VZ)? #define wxRETAINED 0x00020000 #define wxBACKINGSTORE wxRETAINED // set this flag to create a special popup window: it will be always shown on // top of other windows, will capture the mouse and will be dismissed when the // mouse is clicked outside of it or if it loses focus in any other way #define wxPOPUP_WINDOW 0x00020000 // don't invalidate the whole window (resulting in a PAINT event) when the // window is resized (currently, makes sense for wxMSW only) #define wxNO_FULL_REPAINT_ON_RESIZE 0x00010000 /* * Extra window style flags (use wxWS_EX prefix to make it clear that they * should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle()) */ // by default, TransferDataTo/FromWindow() only work on direct children of the // window (compatible behaviour), set this flag to make them recursively // descend into all subwindows #define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001 // wxCommandEvents and the objects of the derived classes are forwarded to the // parent window and so on recursively by default. Using this flag for the // given window allows to block this propagation at this window, i.e. prevent // the events from being propagated further upwards. The dialogs have this // flag on by default. #define wxWS_EX_BLOCK_EVENTS 0x00000002 // don't use this window as an implicit parent for the other windows: this must // be used with transient windows as otherwise there is the risk of creating a // dialog/frame with this window as a parent which would lead to a crash if the // parent is destroyed before the child #define wxWS_EX_TRANSIENT 0x00000004 // Use this style to add a context-sensitive help to the window (currently for // Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) #define wxFRAME_EX_CONTEXTHELP 0x00000004 #define wxDIALOG_EX_CONTEXTHELP 0x00000004 /* * wxFrame/wxDialog style flags */ #define wxSTAY_ON_TOP 0x8000 #define wxICONIZE 0x4000 #define wxMINIMIZE wxICONIZE #define wxMAXIMIZE 0x2000 // free flag value: 0x1000 #define wxSYSTEM_MENU 0x0800 #define wxMINIMIZE_BOX 0x0400 #define wxMAXIMIZE_BOX 0x0200 #define wxTINY_CAPTION_HORIZ 0x0100 #define wxTINY_CAPTION_VERT 0x0080 #define wxRESIZE_BORDER 0x0040 #define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window #define wxFRAME_NO_TASKBAR 0x0002 // No taskbar button (MSW only) #define wxFRAME_TOOL_WINDOW 0x0004 // No taskbar button, no system menu #define wxFRAME_FLOAT_ON_PARENT 0x0008 // Always above its parent #define wxFRAME_SHAPED 0x0010 // Create a window that is able to be shaped // deprecated versions defined for compatibility reasons #define wxRESIZE_BOX wxMAXIMIZE_BOX #define wxTHICK_FRAME wxRESIZE_BORDER // obsolete styles, unused any more #define wxDIALOG_MODAL 0x0020 // free flag value 0x0020 #define wxDIALOG_MODELESS 0x0000 /* * MDI parent frame style flags * Can overlap with some of the above. */ #define wxFRAME_NO_WINDOW_MENU 0x0100 #define wxDEFAULT_FRAME_STYLE \ (wxSYSTEM_MENU | wxRESIZE_BORDER | \ wxMINIMIZE_BOX | wxMAXIMIZE_BOX | \ wxCAPTION | wxCLIP_CHILDREN) #if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMGL__) # define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU | wxCAPTION) #else // Under Unix, the dialogs don't have a system menu. Specifying wxSYSTEM_MENU // here will make a close button appear. # define wxDEFAULT_DIALOG_STYLE wxCAPTION #endif /* * wxExtDialog style flags */ #define wxED_CLIENT_MARGIN 0x0004 #define wxED_BUTTONS_BOTTOM 0x0000 // has no effect #define wxED_BUTTONS_RIGHT 0x0002 #define wxED_STATIC_LINE 0x0001 #if defined(__WXMSW__) || defined(__WXMAC__) # define wxEXT_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxED_CLIENT_MARGIN) #else # define wxEXT_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxED_CLIENT_MARGIN|wxED_STATIC_LINE) #endif /* * wxMenuBar style flags */ // use native docking #define wxMB_DOCKABLE 0x0001 /* * wxMenu style flags */ #define wxMENU_TEAROFF 0x0001 /* * Apply to all panel items */ #define wxCOLOURED 0x0800 #define wxFIXED_LENGTH 0x0400 /* * Styles for wxListBox */ #define wxLB_SORT 0x0010 #define wxLB_SINGLE 0x0020 #define wxLB_MULTIPLE 0x0040 #define wxLB_EXTENDED 0x0080 // wxLB_OWNERDRAW is Windows-only #define wxLB_OWNERDRAW 0x0100 #define wxLB_NEEDED_SB 0x0200 #define wxLB_ALWAYS_SB 0x0400 #define wxLB_HSCROLL wxHSCROLL // always show an entire number of rows #define wxLB_INT_HEIGHT 0x0800 // deprecated synonyms #define wxPROCESS_ENTER 0x0400 // wxTE_PROCESS_ENTER #define wxPASSWORD 0x0800 // wxTE_PASSWORD /* * wxComboBox style flags */ #define wxCB_SIMPLE 0x0004 #define wxCB_SORT 0x0008 #define wxCB_READONLY 0x0010 #define wxCB_DROPDOWN 0x0020 /* * wxRadioBox style flags */ // should we number the items from left to right or from top to bottom in a 2d // radiobox? #define wxRA_LEFTTORIGHT 0x0001 #define wxRA_TOPTOBOTTOM 0x0002 // New, more intuitive names to specify majorDim argument #define wxRA_SPECIFY_COLS 0x0004 #define wxRA_SPECIFY_ROWS 0x0008 // Old names for compatibility #define wxRA_HORIZONTAL 0x0004 #define wxRA_VERTICAL 0x0008 /* * wxRadioButton style flag */ #define wxRB_GROUP 0x0004 #define wxRB_SINGLE 0x0008 /* * wxGauge flags */ #define wxGA_HORIZONTAL 0x0004 #define wxGA_VERTICAL 0x0008 #define wxGA_PROGRESSBAR 0x0010 // Windows only #define wxGA_SMOOTH 0x0020 /* * wxSlider flags */ #define wxSL_HORIZONTAL 0x0004 #define wxSL_VERTICAL 0x0008 // The next one is obsolete - use scroll events instead #define wxSL_NOTIFY_DRAG 0x0000 #define wxSL_TICKS 0x0010 #define wxSL_AUTOTICKS wxSL_TICKS // we don't support manual ticks #define wxSL_LABELS 0x0020 #define wxSL_LEFT 0x0040 #define wxSL_TOP 0x0080 #define wxSL_RIGHT 0x0100 #define wxSL_BOTTOM 0x0200 #define wxSL_BOTH 0x0400 #define wxSL_SELRANGE 0x0800 /* * wxScrollBar flags */ #define wxSB_HORIZONTAL wxHORIZONTAL #define wxSB_VERTICAL wxVERTICAL /* * wxSpinButton flags. * Note that a wxSpinCtrl is sometimes defined as * a wxTextCtrl, and so the flags must be different * from wxTextCtrl's. */ #define wxSP_HORIZONTAL wxHORIZONTAL // 4 #define wxSP_VERTICAL wxVERTICAL // 8 #define wxSP_ARROW_KEYS 0x1000 #define wxSP_WRAP 0x2000 /* * wxSplitterWindow flags */ #define wxSP_NOBORDER 0x0000 #define wxSP_NOSASH 0x0010 #define wxSP_BORDER 0x0020 #define wxSP_PERMIT_UNSPLIT 0x0040 #define wxSP_LIVE_UPDATE 0x0080 #define wxSP_3DSASH 0x0100 #define wxSP_3DBORDER 0x0200 #define wxSP_FULLSASH 0x0400 #define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH) #define wxSP_SASH_AQUA 0x0800 /* * wxNotebook flags */ #define wxNB_FIXEDWIDTH 0x0010 #define wxNB_TOP 0x0000 // default #define wxNB_LEFT 0x0020 #define wxNB_RIGHT 0x0040 #define wxNB_BOTTOM 0x0080 #define wxNB_MULTILINE 0x0100 /* * wxTabCtrl flags */ #define wxTC_RIGHTJUSTIFY 0x0010 #define wxTC_FIXEDWIDTH 0x0020 #define wxTC_TOP 0x0000 // default #define wxTC_LEFT 0x0020 #define wxTC_RIGHT 0x0040 #define wxTC_BOTTOM 0x0080 #define wxTC_MULTILINE wxNB_MULTILINE #define wxTC_OWNERDRAW 0x0200 // wxToolBar style flags #define wxTB_HORIZONTAL 0x0004 #define wxTB_VERTICAL 0x0008 #define wxTB_3DBUTTONS 0x0010 #define wxTB_FLAT 0x0020 // supported only under Win98+/GTK #define wxTB_DOCKABLE 0x0040 // use native docking under GTK #define wxTB_NOICONS 0x0080 // don't show the icons #define wxTB_TEXT 0x0100 // show the text #define wxTB_NODIVIDER 0x0200 // don't show the divider (Windows) #define wxTB_NOALIGN 0x0400 // no automatic alignment (Windows) /* * wxTreeCtrl flags */ #define wxTR_HIDE_ROOT 0x0010 #define wxTR_HAS_BUTTONS 0x0020 #define wxTR_TWIST_BUTTONS 0x0040 #define wxTR_NO_LINES 0x0080 #define wxTR_LINES_AT_ROOT 0x0100 #define wxTR_EDIT_LABELS 0x0200 #define wxTR_ROW_LINES 0x0400 #define wxTR_FULL_ROW_HIGHLIGHT 0x0800 /* * wxStatusBar95 flags */ #define wxST_SIZEGRIP 0x0010 /* * wxStaticText flags */ #define wxST_NO_AUTORESIZE 0x0001 /* * wxStaticBitmap flags */ #define wxBI_EXPAND wxEXPAND /* * wxStaticLine flags */ #define wxLI_HORIZONTAL wxHORIZONTAL #define wxLI_VERTICAL wxVERTICAL /* * wxProgressDialog flags */ #define wxPD_CAN_ABORT 0x0001 #define wxPD_APP_MODAL 0x0002 #define wxPD_AUTO_HIDE 0x0004 #define wxPD_ELAPSED_TIME 0x0008 #define wxPD_ESTIMATED_TIME 0x0010 // wxGA_SMOOTH = 0x0020 may also be used with wxProgressDialog // NO!!! This is wxDIALOG_MODAL and will cause the progress dialog to // be modal. No progress will then be made at all. #define wxPD_REMAINING_TIME 0x0040 /* * wxDirDialog styles */ #define wxDD_NEW_DIR_BUTTON 0x0080 /* * extended dialog specifiers. these values are stored in a different * flag and thus do not overlap with other style flags. note that these * values do not correspond to the return values of the dialogs (for * those values, look at the wxID_XXX defines). */ // wxCENTRE already defined as 0x00000001 #define wxYES 0x00000002 #define wxOK 0x00000004 #define wxNO 0x00000008 #define wxYES_NO (wxYES | wxNO) #define wxCANCEL 0x00000010 #define wxYES_DEFAULT 0x00000000 // has no effect (default) #define wxNO_DEFAULT 0x00000080 #define wxICON_EXCLAMATION 0x00000100 #define wxICON_HAND 0x00000200 #define wxICON_WARNING wxICON_EXCLAMATION #define wxICON_ERROR wxICON_HAND #define wxICON_QUESTION 0x00000400 #define wxICON_INFORMATION 0x00000800 #define wxICON_STOP wxICON_HAND #define wxICON_ASTERISK wxICON_INFORMATION #define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800) #define wxFORWARD 0x00001000 #define wxBACKWARD 0x00002000 #define wxRESET 0x00004000 #define wxHELP 0x00008000 #define wxMORE 0x00010000 #define wxSETUP 0x00020000 // ---------------------------------------------------------------------------- // standard IDs // ---------------------------------------------------------------------------- // any id: means that we don't care about the id, whether when installing an // event handler or when creating a new window enum { wxID_ANY = -1 }; // id for a separator line in the menu (invalid for normal item) enum { wxID_SEPARATOR = -1 }; // Standard menu IDs enum { wxID_LOWEST = 4999, wxID_OPEN, wxID_CLOSE, wxID_NEW, wxID_SAVE, wxID_SAVEAS, wxID_REVERT, wxID_EXIT, wxID_UNDO, wxID_REDO, wxID_HELP, wxID_PRINT, wxID_PRINT_SETUP, wxID_PREVIEW, wxID_ABOUT, wxID_HELP_CONTENTS, wxID_HELP_COMMANDS, wxID_HELP_PROCEDURES, wxID_HELP_CONTEXT, wxID_CLOSE_ALL, wxID_CUT = 5030, wxID_COPY, wxID_PASTE, wxID_CLEAR, wxID_FIND, wxID_DUPLICATE, wxID_SELECTALL, wxID_FILE1 = 5050, wxID_FILE2, wxID_FILE3, wxID_FILE4, wxID_FILE5, wxID_FILE6, wxID_FILE7, wxID_FILE8, wxID_FILE9, // Standard button IDs wxID_OK = 5100, wxID_CANCEL, wxID_APPLY, wxID_YES, wxID_NO, wxID_STATIC, wxID_FORWARD, wxID_BACKWARD, wxID_DEFAULT, wxID_MORE, wxID_SETUP, wxID_RESET, wxID_CONTEXT_HELP, wxID_YESTOALL, wxID_NOTOALL, wxID_ABORT, wxID_RETRY, wxID_IGNORE, // System menu IDs (used by wxUniv): wxID_SYSTEM_MENU = 5200, wxID_CLOSE_FRAME, wxID_MOVE_FRAME, wxID_RESIZE_FRAME, wxID_MAXIMIZE_FRAME, wxID_ICONIZE_FRAME, wxID_RESTORE_FRAME, // IDs used by generic file dialog (13 consecutive starting from this value) wxID_FILEDLGG = 5900, wxID_HIGHEST = 5999 }; // ---------------------------------------------------------------------------- // other constants // ---------------------------------------------------------------------------- // menu and toolbar item kinds enum wxItemKind { wxITEM_SEPARATOR = -1, wxITEM_NORMAL, wxITEM_CHECK, wxITEM_RADIO, wxITEM_MAX }; // hit test results enum wxHitTest { wxHT_NOWHERE, // scrollbar wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE, wxHT_SCROLLBAR_ARROW_LINE_1, // left or upper arrow to scroll by line wxHT_SCROLLBAR_ARROW_LINE_2, // right or down wxHT_SCROLLBAR_ARROW_PAGE_1, // left or upper arrow to scroll by page wxHT_SCROLLBAR_ARROW_PAGE_2, // right or down wxHT_SCROLLBAR_THUMB, // on the thumb wxHT_SCROLLBAR_BAR_1, // bar to the left/above the thumb wxHT_SCROLLBAR_BAR_2, // bar to the right/below the thumb wxHT_SCROLLBAR_LAST, // window wxHT_WINDOW_OUTSIDE, // not in this window at all wxHT_WINDOW_INSIDE, // in the client area wxHT_WINDOW_VERT_SCROLLBAR, // on the vertical scrollbar wxHT_WINDOW_HORZ_SCROLLBAR, // on the horizontal scrollbar wxHT_WINDOW_CORNER, // on the corner between 2 scrollbars wxHT_MAX }; // ---------------------------------------------------------------------------- // Possible SetSize flags // ---------------------------------------------------------------------------- // Use internally-calculated width if -1 #define wxSIZE_AUTO_WIDTH 0x0001 // Use internally-calculated height if -1 #define wxSIZE_AUTO_HEIGHT 0x0002 // Use internally-calculated width and height if each is -1 #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT) // Ignore missing (-1) dimensions (use existing). // For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. #define wxSIZE_USE_EXISTING 0x0000 // Allow -1 as a valid position #define wxSIZE_ALLOW_MINUS_ONE 0x0004 // Don't do parent client adjustments (for implementation only) #define wxSIZE_NO_ADJUSTMENTS 0x0008 // VZ: why doesn't it start with "wx"? FIXME #define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH) // Logical ops typedef enum { wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, // 0 wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, // src XOR dst wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, // NOT dst wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, // src OR (NOT dst) wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, // src AND (NOT dst) wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, // src wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, // src AND dst wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, // (NOT src) AND dst wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, // dst wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, // (NOT src) AND (NOT dst) wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, // (NOT src) XOR dst wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, // (NOT src) wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, // (NOT src) OR dst wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, // (NOT src) OR (NOT dst) wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, // src OR dst wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET // 1 } form_ops_t; // Flood styles enum { wxFLOOD_SURFACE = 1, wxFLOOD_BORDER }; // Polygon filling mode enum { wxODDEVEN_RULE = 1, wxWINDING_RULE }; // ToolPanel in wxFrame (VZ: unused?) enum { wxTOOL_TOP = 1, wxTOOL_BOTTOM, wxTOOL_LEFT, wxTOOL_RIGHT }; // the values of the format constants should be the same as correspondign // CF_XXX constants in Windows API enum wxDataFormatId { wxDF_INVALID = 0, wxDF_TEXT = 1, /* CF_TEXT */ wxDF_BITMAP = 2, /* CF_BITMAP */ wxDF_METAFILE = 3, /* CF_METAFILEPICT */ wxDF_SYLK = 4, wxDF_DIF = 5, wxDF_TIFF = 6, wxDF_OEMTEXT = 7, /* CF_OEMTEXT */ wxDF_DIB = 8, /* CF_DIB */ wxDF_PALETTE = 9, wxDF_PENDATA = 10, wxDF_RIFF = 11, wxDF_WAVE = 12, wxDF_UNICODETEXT = 13, wxDF_ENHMETAFILE = 14, wxDF_FILENAME = 15, /* CF_HDROP */ wxDF_LOCALE = 16, wxDF_PRIVATE = 20, wxDF_HTML = 30, /* Note: does not correspond to CF_ constant */ wxDF_MAX }; // Virtual keycodes enum wxKeyCode { WXK_BACK = 8, WXK_TAB = 9, WXK_RETURN = 13, WXK_ESCAPE = 27, WXK_SPACE = 32, WXK_DELETE = 127, WXK_START = 300, WXK_LBUTTON, WXK_RBUTTON, WXK_CANCEL, WXK_MBUTTON, WXK_CLEAR, WXK_SHIFT, WXK_ALT, WXK_CONTROL, WXK_MENU, WXK_PAUSE, WXK_CAPITAL, WXK_PRIOR, // Page up WXK_NEXT, // Page down WXK_END, WXK_HOME, WXK_LEFT, WXK_UP, WXK_RIGHT, WXK_DOWN, WXK_SELECT, WXK_PRINT, WXK_EXECUTE, WXK_SNAPSHOT, WXK_INSERT, WXK_HELP, WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4, WXK_NUMPAD5, WXK_NUMPAD6, WXK_NUMPAD7, WXK_NUMPAD8, WXK_NUMPAD9, WXK_MULTIPLY, WXK_ADD, WXK_SEPARATOR, WXK_SUBTRACT, WXK_DECIMAL, WXK_DIVIDE, WXK_F1, WXK_F2, WXK_F3, WXK_F4, WXK_F5, WXK_F6, WXK_F7, WXK_F8, WXK_F9, WXK_F10, WXK_F11, WXK_F12, WXK_F13, WXK_F14, WXK_F15, WXK_F16, WXK_F17, WXK_F18, WXK_F19, WXK_F20, WXK_F21, WXK_F22, WXK_F23, WXK_F24, WXK_NUMLOCK, WXK_SCROLL, WXK_PAGEUP, WXK_PAGEDOWN, WXK_NUMPAD_SPACE, WXK_NUMPAD_TAB, WXK_NUMPAD_ENTER, WXK_NUMPAD_F1, WXK_NUMPAD_F2, WXK_NUMPAD_F3, WXK_NUMPAD_F4, WXK_NUMPAD_HOME, WXK_NUMPAD_LEFT, WXK_NUMPAD_UP, WXK_NUMPAD_RIGHT, WXK_NUMPAD_DOWN, WXK_NUMPAD_PRIOR, WXK_NUMPAD_PAGEUP, WXK_NUMPAD_NEXT, WXK_NUMPAD_PAGEDOWN, WXK_NUMPAD_END, WXK_NUMPAD_BEGIN, WXK_NUMPAD_INSERT, WXK_NUMPAD_DELETE, WXK_NUMPAD_EQUAL, WXK_NUMPAD_MULTIPLY, WXK_NUMPAD_ADD, WXK_NUMPAD_SEPARATOR, WXK_NUMPAD_SUBTRACT, WXK_NUMPAD_DECIMAL, WXK_NUMPAD_DIVIDE }; // Mapping modes (same values as used by Windows, don't change) enum { wxMM_TEXT = 1, wxMM_LOMETRIC, wxMM_HIMETRIC, wxMM_LOENGLISH, wxMM_HIENGLISH, wxMM_TWIPS, wxMM_ISOTROPIC, wxMM_ANISOTROPIC, wxMM_POINTS, wxMM_METRIC }; /* Shortcut for easier dialog-unit-to-pixel conversion */ #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) /* Paper types */ typedef enum { wxPAPER_NONE, // Use specific dimensions wxPAPER_LETTER, // Letter, 8 1/2 by 11 inches wxPAPER_LEGAL, // Legal, 8 1/2 by 14 inches wxPAPER_A4, // A4 Sheet, 210 by 297 millimeters wxPAPER_CSHEET, // C Sheet, 17 by 22 inches wxPAPER_DSHEET, // D Sheet, 22 by 34 inches wxPAPER_ESHEET, // E Sheet, 34 by 44 inches wxPAPER_LETTERSMALL, // Letter Small, 8 1/2 by 11 inches wxPAPER_TABLOID, // Tabloid, 11 by 17 inches wxPAPER_LEDGER, // Ledger, 17 by 11 inches wxPAPER_STATEMENT, // Statement, 5 1/2 by 8 1/2 inches wxPAPER_EXECUTIVE, // Executive, 7 1/4 by 10 1/2 inches wxPAPER_A3, // A3 sheet, 297 by 420 millimeters wxPAPER_A4SMALL, // A4 small sheet, 210 by 297 millimeters wxPAPER_A5, // A5 sheet, 148 by 210 millimeters wxPAPER_B4, // B4 sheet, 250 by 354 millimeters wxPAPER_B5, // B5 sheet, 182-by-257-millimeter paper wxPAPER_FOLIO, // Folio, 8-1/2-by-13-inch paper wxPAPER_QUARTO, // Quarto, 215-by-275-millimeter paper wxPAPER_10X14, // 10-by-14-inch sheet wxPAPER_11X17, // 11-by-17-inch sheet wxPAPER_NOTE, // Note, 8 1/2 by 11 inches wxPAPER_ENV_9, // #9 Envelope, 3 7/8 by 8 7/8 inches wxPAPER_ENV_10, // #10 Envelope, 4 1/8 by 9 1/2 inches wxPAPER_ENV_11, // #11 Envelope, 4 1/2 by 10 3/8 inches wxPAPER_ENV_12, // #12 Envelope, 4 3/4 by 11 inches wxPAPER_ENV_14, // #14 Envelope, 5 by 11 1/2 inches wxPAPER_ENV_DL, // DL Envelope, 110 by 220 millimeters wxPAPER_ENV_C5, // C5 Envelope, 162 by 229 millimeters wxPAPER_ENV_C3, // C3 Envelope, 324 by 458 millimeters wxPAPER_ENV_C4, // C4 Envelope, 229 by 324 millimeters wxPAPER_ENV_C6, // C6 Envelope, 114 by 162 millimeters wxPAPER_ENV_C65, // C65 Envelope, 114 by 229 millimeters wxPAPER_ENV_B4, // B4 Envelope, 250 by 353 millimeters wxPAPER_ENV_B5, // B5 Envelope, 176 by 250 millimeters wxPAPER_ENV_B6, // B6 Envelope, 176 by 125 millimeters wxPAPER_ENV_ITALY, // Italy Envelope, 110 by 230 millimeters wxPAPER_ENV_MONARCH, // Monarch Envelope, 3 7/8 by 7 1/2 inches wxPAPER_ENV_PERSONAL, // 6 3/4 Envelope, 3 5/8 by 6 1/2 inches wxPAPER_FANFOLD_US, // US Std Fanfold, 14 7/8 by 11 inches wxPAPER_FANFOLD_STD_GERMAN, // German Std Fanfold, 8 1/2 by 12 inches wxPAPER_FANFOLD_LGL_GERMAN, // German Legal Fanfold, 8 1/2 by 13 inches wxPAPER_ISO_B4, // B4 (ISO) 250 x 353 mm wxPAPER_JAPANESE_POSTCARD, // Japanese Postcard 100 x 148 mm wxPAPER_9X11, // 9 x 11 in wxPAPER_10X11, // 10 x 11 in wxPAPER_15X11, // 15 x 11 in wxPAPER_ENV_INVITE, // Envelope Invite 220 x 220 mm wxPAPER_LETTER_EXTRA, // Letter Extra 9 \275 x 12 in wxPAPER_LEGAL_EXTRA, // Legal Extra 9 \275 x 15 in wxPAPER_TABLOID_EXTRA, // Tabloid Extra 11.69 x 18 in wxPAPER_A4_EXTRA, // A4 Extra 9.27 x 12.69 in wxPAPER_LETTER_TRANSVERSE, // Letter Transverse 8 \275 x 11 in wxPAPER_A4_TRANSVERSE, // A4 Transverse 210 x 297 mm wxPAPER_LETTER_EXTRA_TRANSVERSE, // Letter Extra Transverse 9\275 x 12 in wxPAPER_A_PLUS, // SuperA/SuperA/A4 227 x 356 mm wxPAPER_B_PLUS, // SuperB/SuperB/A3 305 x 487 mm wxPAPER_LETTER_PLUS, // Letter Plus 8.5 x 12.69 in wxPAPER_A4_PLUS, // A4 Plus 210 x 330 mm wxPAPER_A5_TRANSVERSE, // A5 Transverse 148 x 210 mm wxPAPER_B5_TRANSVERSE, // B5 (JIS) Transverse 182 x 257 mm wxPAPER_A3_EXTRA, // A3 Extra 322 x 445 mm wxPAPER_A5_EXTRA, // A5 Extra 174 x 235 mm wxPAPER_B5_EXTRA, // B5 (ISO) Extra 201 x 276 mm wxPAPER_A2, // A2 420 x 594 mm wxPAPER_A3_TRANSVERSE, // A3 Transverse 297 x 420 mm wxPAPER_A3_EXTRA_TRANSVERSE // A3 Extra Transverse 322 x 445 mm } wxPaperSize; /* Printing orientation */ #ifndef wxPORTRAIT #define wxPORTRAIT 1 #define wxLANDSCAPE 2 #endif /* Duplex printing modes */ enum wxDuplexMode { wxDUPLEX_SIMPLEX, // Non-duplex wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL }; /* Print quality. */ #define wxPRINT_QUALITY_HIGH -1 #define wxPRINT_QUALITY_MEDIUM -2 #define wxPRINT_QUALITY_LOW -3 #define wxPRINT_QUALITY_DRAFT -4 typedef int wxPrintQuality; /* Print mode (currently PostScript only) */ enum wxPrintMode { wxPRINT_MODE_NONE = 0, wxPRINT_MODE_PREVIEW = 1, // Preview in external application wxPRINT_MODE_FILE = 2, // Print to file wxPRINT_MODE_PRINTER = 3 // Send to printer }; // ---------------------------------------------------------------------------- // wxTextCtrl style flags // ---------------------------------------------------------------------------- // the flag bits 0x0001, and 0x0004 are free but should be used only for the // things which don't make sense for a text control used by wxTextEntryDialog // because they would otherwise conflict with wxOK, wxCANCEL, wxCENTRE #define wxTE_NO_VSCROLL 0x0002 #define wxTE_AUTO_SCROLL 0x0008 #define wxTE_READONLY 0x0010 #define wxTE_MULTILINE 0x0020 #define wxTE_PROCESS_TAB 0x0040 // alignment flags #define wxTE_LEFT 0x0000 // 0x0000 #define wxTE_CENTER wxALIGN_CENTER_HORIZONTAL // 0x0100 #define wxTE_RIGHT wxALIGN_RIGHT // 0x0200 #define wxTE_CENTRE wxTE_CENTER // this style means to use RICHEDIT control and does something only under wxMSW // and Win32 and is silently ignored under all other platforms #define wxTE_RICH 0x0080 #define wxTE_PROCESS_ENTER 0x0400 #define wxTE_PASSWORD 0x0800 // automatically detect the URLs and generate the events when mouse is // moved/clicked over an URL // // this is for Win32 richedit controls only so far #define wxTE_AUTO_URL 0x1000 // by default, the Windows text control doesn't show the selection when it // doesn't have focus - use this style to force it to always show it #define wxTE_NOHIDESEL 0x2000 // use wxHSCROLL to not wrap text at all, wxTE_LINEWRAP to wrap it at any // position and wxTE_WORDWRAP to wrap at words boundary #define wxTE_DONTWRAP wxHSCROLL #define wxTE_LINEWRAP 0x4000 #define wxTE_WORDWRAP 0x0000 // it's just == !wxHSCROLL // force using RichEdit version 2.0 or 3.0 instead of 1.0 (default) for // wxTE_RICH controls - can be used together with or instead of wxTE_RICH #define wxTE_RICH2 0x8000 // ---------------------------------------------------------------------------- // miscellaneous // ---------------------------------------------------------------------------- // define this macro if font handling is done using the X font names #if (defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__X__) #define _WX_X_FONTLIKE #endif // macro to specify "All Files" on different platforms #if defined(__WXMSW__) || defined(__WXPM__) # define wxALL_FILES_PATTERN wxT("*.*") # define wxALL_FILES gettext_noop("All files (*.*)|*.*") #else # define wxALL_FILES_PATTERN wxT("*") # define wxALL_FILES gettext_noop("All files (*)|*") #endif enum wxBitmapType { wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility! wxBITMAP_TYPE_BMP, wxBITMAP_TYPE_BMP_RESOURCE, wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE, wxBITMAP_TYPE_ICO, wxBITMAP_TYPE_ICO_RESOURCE, wxBITMAP_TYPE_CUR, wxBITMAP_TYPE_CUR_RESOURCE, wxBITMAP_TYPE_XBM, wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, wxBITMAP_TYPE_TIF, wxBITMAP_TYPE_TIF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, wxBITMAP_TYPE_PNG_RESOURCE, wxBITMAP_TYPE_JPEG, wxBITMAP_TYPE_JPEG_RESOURCE, wxBITMAP_TYPE_PNM, wxBITMAP_TYPE_PNM_RESOURCE, wxBITMAP_TYPE_PCX, wxBITMAP_TYPE_PCX_RESOURCE, wxBITMAP_TYPE_PICT, wxBITMAP_TYPE_PICT_RESOURCE, wxBITMAP_TYPE_ICON, wxBITMAP_TYPE_ICON_RESOURCE, wxBITMAP_TYPE_ANI, wxBITMAP_TYPE_IFF, wxBITMAP_TYPE_MACCURSOR, wxBITMAP_TYPE_MACCURSOR_RESOURCE, wxBITMAP_TYPE_ANY = 50 }; %constant wxDD_NEW_DIR_BUTTON = 0x0080 /* * Just include the font encodings */ // ---------------------------------------------------------------------------- // GDI descriptions // ---------------------------------------------------------------------------- enum { // Text font families wxDEFAULT = 70, wxDECORATIVE, wxROMAN, wxSCRIPT, wxSWISS, wxMODERN, wxTELETYPE, /* @@@@ */ // Proportional or Fixed width fonts (not yet used) wxVARIABLE = 80, wxFIXED, wxNORMAL = 90, wxLIGHT, wxBOLD, // Also wxNORMAL for normal (non-italic text) wxITALIC, wxSLANT, // Pen styles wxSOLID = 100, wxDOT, wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH, wxUSER_DASH, wxTRANSPARENT, // Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! // Note also that stippling a Pen IS meaningfull, because a Line is wxSTIPPLE_MASK_OPAQUE, //mask is used for blitting monochrome using text fore and back ground colors wxSTIPPLE_MASK, //mask is used for masking areas in the stipple bitmap (TO DO) // drawn with a Pen, and without any Brush -- and it can be stippled. wxSTIPPLE = 110, wxBDIAGONAL_HATCH, wxCROSSDIAG_HATCH, wxFDIAGONAL_HATCH, wxCROSS_HATCH, wxHORIZONTAL_HATCH, wxVERTICAL_HATCH, wxJOIN_BEVEL = 120, wxJOIN_MITER, wxJOIN_ROUND, wxCAP_ROUND = 130, wxCAP_PROJECTING, wxCAP_BUTT }; // Standard cursors enum wxStockCursor { wxCURSOR_NONE, // should be 0 wxCURSOR_ARROW, wxCURSOR_RIGHT_ARROW, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_CROSS, wxCURSOR_HAND, wxCURSOR_IBEAM, wxCURSOR_LEFT_BUTTON, wxCURSOR_MAGNIFIER, wxCURSOR_MIDDLE_BUTTON, wxCURSOR_NO_ENTRY, wxCURSOR_PAINT_BRUSH, wxCURSOR_PENCIL, wxCURSOR_POINT_LEFT, wxCURSOR_POINT_RIGHT, wxCURSOR_QUESTION_ARROW, wxCURSOR_RIGHT_BUTTON, wxCURSOR_SIZENESW, wxCURSOR_SIZENS, wxCURSOR_SIZENWSE, wxCURSOR_SIZEWE, wxCURSOR_SIZING, wxCURSOR_SPRAYCAN, wxCURSOR_WAIT, wxCURSOR_WATCH, wxCURSOR_BLANK, #ifdef __WXGTK__ wxCURSOR_DEFAULT, // standard X11 cursor #endif #ifdef __WXMAC__ wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow #endif #ifdef __X__ // Not yet implemented for Windows wxCURSOR_CROSS_REVERSE, wxCURSOR_DOUBLE_ARROW, wxCURSOR_BASED_ARROW_UP, wxCURSOR_BASED_ARROW_DOWN, #endif // X11 wxCURSOR_ARROWWAIT, wxCURSOR_MAX }; #define wxLC_VRULES 0x0001 #define wxLC_HRULES 0x0002 #define wxLC_ICON 0x0004 #define wxLC_SMALL_ICON 0x0008 #define wxLC_LIST 0x0010 #define wxLC_REPORT 0x0020 #define wxLC_ALIGN_TOP 0x0040 #define wxLC_ALIGN_LEFT 0x0080 #define wxLC_AUTOARRANGE 0x0100 #define wxLC_VIRTUAL 0x0200 #define wxLC_EDIT_LABELS 0x0400 #define wxLC_NO_HEADER 0x0800 #define wxLC_NO_SORT_HEADER 0x1000 #define wxLC_SINGLE_SEL 0x2000 #define wxLC_SORT_ASCENDING 0x4000 #define wxLC_SORT_DESCENDING 0x8000 #define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT) #define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT) #define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING) // for compatibility only #define wxLC_USER_TEXT wxLC_VIRTUAL #ifndef __WXGTK__ #define wxCURSOR_DEFAULT wxCURSOR_ARROW #endif %constant const wxSize DEFAULT_SIZE = wxDefaultSize; %constant const wxPoint DEFAULT_POSITION = wxDefaultPosition; # I don't know why SWIG didn't already handle this--it seems # to be confused because the original values were enums %constant wxBorder wxDOUBLE_BORDER = wxBORDER_DOUBLE; %constant wxBorder wxSUNKEN_BORDER = wxBORDER_SUNKEN; %constant wxBorder wxRAISED_BORDER = wxBORDER_RAISED; %constant wxBorder wxBORDER = wxBORDER_SIMPLE; %constant wxBorder wxSIMPLE_BORDER = wxBORDER_SIMPLE; %constant wxBorder wxSTATIC_BORDER = wxBORDER_STATIC; %constant wxBorder wxNO_BORDER = wxBORDER_NONE; // Text font families %constant int FONTFAMILY_DEFAULT = wxDEFAULT; %constant int FONTFAMILY_DECORATIVE = wxDECORATIVE; %constant int FONTFAMILY_ROMAN = wxROMAN; %constant int FONTFAMILY_SCRIPT = wxSCRIPT; %constant int FONTFAMILY_SWISS = wxSWISS; %constant int FONTFAMILY_MODERN = wxMODERN; %constant int FONTFAMILY_TELETYPE = wxTELETYPE; /* @@@@ */ %constant int FONTWEIGHT_NORMAL = wxNORMAL; %constant int FONTWEIGHT_LIGHT = wxLIGHT; %constant int FONTWEIGHT_BOLD = wxBOLD; %constant int FONTSTYLE_NORMAL = wxNORMAL; %constant int FONTSTYLE_ITALIC = wxITALIC; %constant int FONTSTYLE_SLANT = wxSLANT; // Pen styles %constant int SOLID = wxSOLID; %constant int DOT = wxDOT; %constant int LONG_DASH = wxLONG_DASH; %constant int SHORT_DASH = wxSHORT_DASH; %constant int DOT_DASH = wxDOT_DASH; %constant int USER_DASH = wxUSER_DASH; %constant int TRANSPARENT = wxTRANSPARENT; %constant const char *FILE_SELECTOR_DEFAULT_WILDCARD_STR = "*.*"; %constant const char * ART_TOOLBAR = wxART_TOOLBAR_C; %constant const char * ART_MENU = wxART_MENU_C; %constant const char * ART_FRAME_ICON = wxART_FRAME_ICON_C; %constant const char * ART_CMN_DIALOG = wxART_CMN_DIALOG_C; %constant const char * ART_HELP_BROWSER = wxART_HELP_BROWSER_C; %constant const char * ART_MESSAGE_BOX = wxART_MESSAGE_BOX_C; %constant const char * ART_OTHER = wxART_OTHER_C; %constant const char * ART_ADD_BOOKMARK = wxART_ADD_BOOKMARK; %constant const char * ART_DEL_BOOKMARK = wxART_DEL_BOOKMARK; %constant const char * ART_HELP_SIDE_PANEL = wxART_HELP_SIDE_PANEL; %constant const char * ART_HELP_SETTINGS = wxART_HELP_SETTINGS; %constant const char * ART_HELP_BOOK = wxART_HELP_BOOK; %constant const char * ART_HELP_FOLDER = wxART_HELP_FOLDER; %constant const char * ART_HELP_PAGE = wxART_HELP_PAGE; %constant const char * ART_GO_BACK = wxART_GO_BACK; %constant const char * ART_GO_FORWARD = wxART_GO_FORWARD; %constant const char * ART_GO_UP = wxART_GO_UP; %constant const char * ART_GO_DOWN = wxART_GO_DOWN; %constant const char * ART_GO_TO_PARENT = wxART_GO_TO_PARENT; %constant const char * ART_GO_HOME = wxART_GO_HOME; %constant const char * ART_FILE_OPEN = wxART_FILE_OPEN; %constant const char * ART_PRINT = wxART_PRINT; %constant const char * ART_HELP = wxART_HELP; %constant const char * ART_TIP = wxART_TIP; %constant const char * ART_REPORT_VIEW = wxART_REPORT_VIEW; %constant const char * ART_LIST_VIEW = wxART_LIST_VIEW; %constant const char * ART_NEW_DIR = wxART_NEW_DIR; %constant const char * ART_FOLDER = wxART_FOLDER; %constant const char * ART_GO_DIR_UP = wxART_GO_DIR_UP; %constant const char * ART_EXECUTABLE_FILE = wxART_EXECUTABLE_FILE; %constant const char * ART_NORMAL_FILE = wxART_NORMAL_FILE; %constant const char * ART_TICK_MARK = wxART_TICK_MARK; %constant const char * ART_CROSS_MARK = wxART_CROSS_MARK; %constant const char * ART_ERROR = wxART_ERROR; %constant const char * ART_QUESTION = wxART_QUESTION; %constant const char * ART_WARNING = wxART_WARNING; %constant const char * ART_INFORMATION = wxART_INFORMATION; %constant const char * ART_MISSING_IMAGE = wxART_MISSING_IMAGE; %constant const int LAYOUT_UNCONSTRAIINED = wxUnconstrained; %constant const int LAYOUT_AS_IS = wxAsIs; %constant const int LAYOUT_PERCENT_OF = wxPercentOf; %constant const int LAYOUT_ABOVE = wxAbove; %constant const int LAYOUT_BELOW = wxBelow; %constant const int LAYOUT_LEFT_OF = wxLeftOf; %constant const int LAYOUT_RIGHT_OF = wxRightOf; %constant const int LAYOUT_SAME_AS = wxSameAs; %constant const int LAYOUT_ABSOLUTE = wxAbsolute; %constant const int LAYOUT_LEFT =wxLeft; %constant const int LAYOUT_TOP =wxTop; %constant const int LAYOUT_RIGHT =wxRight; %constant const int LAYOUT_BOTTOM =wxBottom; %constant const int LAYOUT_WIDTH =wxWidth; %constant const int LAYOUT_HEIGHT =wxHeight; %constant const int LAYOUT_CENTRE =wxCentre; %constant const int LAYOUT_CENTER =wxCenter; %constant const int LAYOUT_CENTRE_X =wxCentreX; %constant const int LAYOUT_CENTRE_Y =wxCentreY; %constant const int NOT_FOUND = -1; -------------- next part -------------- # Copyright 2004 by Kevin Smith # released under the wxWidgets license # as part of the wxRuby project %include "../common.i" %module(directors="1") wxTreeCtrl %{ #include %} %ignore wxTreeCtrl::wxTreeCtrl(); %ignore wxTreeCtrl::EndEditLabel(bool cancelEdit); %ignore wxTreeCtrl::GetParent(const wxTreeItemId& item) const; %ignore wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int selImage) const; %ignore wxTreeCtrl::SelectItem(const wxTreeItemId& item); %ignore wxTreeCtrl::GetFirstChild(const wxTreeItemId& item , long& cookie ) const; %include "include/wxTreeCtrl.h" From usrlocalinfo at yahoo.com Tue May 3 14:09:59 2005 From: usrlocalinfo at yahoo.com (DJB) Date: Tue May 3 14:05:36 2005 Subject: [Wxruby-users] Making it easier to contribute wxRuby-SWIG code Message-ID: After seeing contributions from Dmitry and Alex, I'm wondering how we can better organize and encourage user contributions. ORGANIZING Maybe identifying what is still missing in wxRuby-SWIG and publishing a prioritized todo list could useful to contributors. GETTING NOTICED It might be useful to post a link to the unassigned todo list each month to comp.lang.ruby and ask for voluteers. I'm sure there are folks that wouldn't mind using wxRuby as a way to learn/practice ruby and SWIG. GIVING RECOGNITION At each volunteer's option, it would be a nice gesture to give them credit for their contribution on the wxRuby website. For some, this might serve as additional incentive to contribute. From alex at pressure.to Tue May 3 18:26:39 2005 From: alex at pressure.to (Alex Fenton) Date: Tue May 3 18:20:34 2005 Subject: [Wxruby-users] Making it easier to contribute wxRuby-SWIG code In-Reply-To: References: Message-ID: <4277FA9F.3020700@pressure.to> DJB wrote: > ORGANIZING > Maybe identifying what is still missing in wxRuby-SWIG and publishing > a prioritized todo list could useful to contributors. I've run out a quick list comparing wxruby-swig (plus a few eg GridCellEditor) compared to wxruby 0.6.0 . It's on the wiki at the bottom of the page at http://wxruby.rubyforge.org/wiki/wiki.pl?How_To_Add_A_New_Class_To_Wxruby-Swig The more wxruby-swig matches the classes available in wxruby, the wider the audience of people with existing Wx applications who can try running their existing ruby code against the wxruby-swig. a From alex at pressure.to Tue May 3 19:24:53 2005 From: alex at pressure.to (Alex Fenton) Date: Tue May 3 19:18:44 2005 Subject: [Wxruby-users] where is destructors? In-Reply-To: <1296450182.20050504002309@ubiz.ru> References: <1495699715.20050503010322@ubiz.ru> <4276BA54.8030501@qualitycode.com> <1296450182.20050504002309@ubiz.ru> Message-ID: <42780845.1020606@pressure.to> >KS> In fact, this is one of the most compelling reasons to shift to SWIG. >KS> Another big one is SWIG's "directors", which make it super easy to >KS> support ruby methods overriding virtual C++ methods. > >:-) You convict me to look at swig again. Especially after today >fighting with wxpp.rb, when i`m tried to implement correct wrapper for >wxHtmlWindow::OnLinkClicked > > :) Definitely worth another look - once I had the toolchain set up and the basic idea figured out, I was able to get four or five Wx classes working in a few hours. I've added some more notes on the Wiki page about Hacking Wxruby-swig. cheers a From xgoober99 at hotmail.com Fri May 6 03:23:28 2005 From: xgoober99 at hotmail.com (no body) Date: Fri May 6 03:17:13 2005 Subject: [Wxruby-users] Problems setting image data Message-ID: Hi, I've been having some intermittent (but repeatable) problems using Image#set_data. In some cases, I get just a black image drawn after I've set a (non-black) image. Other times I get a MSVC++ runtime exception. It happens on the same files at the same time. I'm confident that I'm setting the correct amount of data for the image size. (Note: Ruby 1.8.2, WxRuby 0.6.0, Windows XP) Possible problems: 1. I'm reusing the same Image object that has been created before and painted (via creation of a Bitmap). So I'm calling .set_data on something that's been around for a while. This shouldn't be a problem, right? 2. Memory allocation. The data object is a String, created via something like: 'x = "a"*some_length' in a method and class far away from where it gets used to set the image's data. Could this be a garbage collection issue? If so, why only sometimes? Is there a better way to allocate space? 3. Since it's repeatable with the same image data and the same image processing steps, perhaps it's a data content issue? Is there any reason image.set_data would choke on a String of the correct length because of the data contents? Interestingly it appears to only happen on images that don't have a mask (but maybe that's just the way my data is...). This is an image processing application, and interestingly I've never seen the problem happen when loading from a file. It only happens after some image processing has taken place on the data. Any ideas of things to investigate? I'm at my wit's end on this... Thanks, Kian W _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From xgoober99 at hotmail.com Fri May 6 04:06:38 2005 From: xgoober99 at hotmail.com (no body) Date: Fri May 6 04:00:27 2005 Subject: [Wxruby-users] Problems setting image data In-Reply-To: Message-ID: I previously wrote: > >I've been having some intermittent (but repeatable) problems using >Image#set_data. In some cases, I get just a black image drawn after I've >set a (non-black) image. Other times I get a MSVC++ runtime exception. ... >1. I'm reusing the same Image object that has been created before and >painted (via creation of a Bitmap). So I'm calling .set_data on something >that's been around for a while. This shouldn't be a problem, right? Answered my own question I guess... Creating a new Image object instead of reusing the old one appears to work fine so far. Will do more testing, but so far so good... KW _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From wxruby at qualitycode.com Fri May 6 08:47:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri May 6 08:41:32 2005 Subject: [Wxruby-users] Problems setting image data In-Reply-To: References: Message-ID: <427B6763.1090400@qualitycode.com> no body wrote: > I previously wrote: > >> >> I've been having some intermittent (but repeatable) problems using >> Image#set_data. In some cases, I get just a black image drawn after >> I've set a (non-black) image. Other times I get a MSVC++ runtime >> exception. > > ... > >> 1. I'm reusing the same Image object that has been created before and >> painted (via creation of a Bitmap). So I'm calling .set_data on >> something that's been around for a while. This shouldn't be a problem, >> right? > > > Answered my own question I guess... Creating a new Image object instead > of reusing the old one appears to work fine so far. Will do more > testing, but so far so good... There is nothing in the wxruby source code that should affect this. Looking at the wxWindows source code, it appears that set_data can only be used if the image is exactly the same size and depth, and has exactly the same mask. Within those constraints, I don't see why it wouldn't work. The wx header comment for set_data (or SetData, as they call it) is: // these functions provide fastest access to wxImage data but should be // used carefully as no checks are done Kevin From dmiceman at ubiz.ru Fri May 6 09:07:58 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Fri May 6 09:01:57 2005 Subject: [Wxruby-users] Problems setting image data In-Reply-To: References: Message-ID: <1201238068.20050506220758@ubiz.ru> Hello. You wrote 06.05.2005, 17:06:38: nb> Answered my own question I guess... Creating a new Image object instead of nb> reusing the old one appears to work fine so far. Will do more testing, but nb> so far so good... Also probably you need to call Wx::Image.destroy manually after using image. This is because wxruby does not call wxImage destructor properly. -- Dmitry mailto:dmiceman@ubiz.ru From devel at nicreations.com Fri May 6 23:55:20 2005 From: devel at nicreations.com (Nick) Date: Fri May 6 23:52:16 2005 Subject: [Wxruby-users] Wx::HtmlWindow.on_link_clicked In-Reply-To: <02859667.20050504004755@ubiz.ru> References: <02859667.20050504004755@ubiz.ru> Message-ID: <427C3C28.2090100@nicreations.com> Thanks for the contributions. I'll try to get them in this weekend, though the 10 hour workdays have been prohibitive. I'm glad for all the contributions, but I'd appricate if you focused on the SWIG code. You don't SWIG/Rake/etc to build it - you can use the extconf.rb in the src directory. Nick Dmitry Morozhnikov wrote: > Hello, wxruby-users. > > This is an addition which implement wrapper for > overloading wxHtmlWindow::OnLinkClicked method. Unfortunately, it was > impossible to make it correctly without ugly hack to wxpp.rb, but i`m > hope it does not broke it. > > Please look at attachment for a patch for htmlwindow.t and wxpp.rb and > additional file htmllinkinfo.t (need to be added to $objs array in > extconf.rb). > > Sample code of fancy about dialog for windows (for windows -- because > of using function from shell32.dll to call favorite email client and > favorite browser): > > ===================================================== > require 'Win32API' > require 'wxruby' > class WrappedHtml < Wx::HtmlWindow > def initialize(*args) > super > @shell = Win32API.new('shell32', 'ShellExecute', 'LPPPPI', 'L') > end > def on_link_clicked(link) > @shell.call 0, 'open', link.get_href, nil, nil, 1 > end > end > class App < Wx::App > def on_init > dialog = Wx::Dialog.new nil, -1, 'About' > sizer = Wx::BoxSizer.new Wx::VERTICAL > dialog.set_sizer sizer > html = WrappedHtml.new dialog, -1 > html.set_page < > > My wife web project
> mail me
> > > EOF > sizer.add html, 1, Wx::EXPAND > dialog.set_size Wx::Size.new(400, 300) > dialog.center_on_screen Wx::BOTH > dialog.show true > dialog.evt_close do exit_main_loop end > end > end > app = App.new > app.main_loop > ===================================================== > > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From devel at nicreations.com Sat May 7 00:00:48 2005 From: devel at nicreations.com (Nick) Date: Fri May 6 23:57:50 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <42776BB1.6070305@pressure.to> References: <42776BB1.6070305@pressure.to> Message-ID: <427C3D70.2050809@nicreations.com> The SWIG version is so very close for release. It needs to be pounded on a little bit more, and it needs to be built with 2.6. Sadly, since March I've been working lots of weekends and long days due to new employment. I tried building 2.6 on my Mac one night and it had multiple build errors. I'd like to get a Tiger build made as soon as I have a chance to pick up a copy (or pick up a new G5... drool...). I'll try building 2.6 with windows this weekend. Nick Alex Fenton wrote: > DJB wrote: > >> If wxRuby-SWIG is as usable as wxRuby 0.6.0, maybe it should be given >> a version number and packaged up for download. > > > Unfortunately wxruby-swig isn't yet as usable as wxruby-0.6.0 - it > currently supports fewer methods and classes. > > There was a discussion on this list recently of version, for which see: > http://rubyforge.org/pipermail/wxruby-users/2005-February/001140.html > > Still, neither of these prevents wxruby-swig being packaged and offered > for download rather than having it available only via anon CVS. > >> Given the nature of SWIG, having a lot more people use it would >> probably result in more code contributions to this project. > > > It would be great to see wxruby-swig move forward, but from experience I > have to say that even with SWIG, a fair amount of C/C++ knowledge is > needed to contribute classes. > >> Seems most of the changes are 2+ months old, so I'm guessing >> wxRuby-SWIG is fairly stable right now in terms of frequency of >> changes... > > > I think several of the wxruby developers have been heavily weighed down > with other commitments in the past few months, and so have not been able > to work on wxruby as much. I think the CVS history reflects this rather > than wxruby-swig's stability. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Sat May 7 07:42:27 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat May 7 07:36:21 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427C3D70.2050809@nicreations.com> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> Message-ID: <427CA9A3.1050009@qualitycode.com> Nick wrote: > > The SWIG version is so very close for release. It needs to be pounded on > a little bit more, and it needs to be built with 2.6. Sadly, since March > I've been working lots of weekends and long days due to new employment. > > I tried building 2.6 on my Mac one night and it had multiple build > errors. I'd like to get a Tiger build made as soon as I have a chance to > pick up a copy (or pick up a new G5... drool...). > > I'll try building 2.6 with windows this weekend. I forget whether you decide that wxruby-swig would only work with wx 2.6, or if it would work with 2.4 or 2.6. If the latter, a 2.4-only tarball release of wxruby-swig would still be very valuable. Similarly, pre-release tarballs on any of the platforms would encourage more testing. Kevin From dmiceman at ubiz.ru Sat May 7 07:36:25 2005 From: dmiceman at ubiz.ru (Dmitry Morozhnikov) Date: Sat May 7 08:26:24 2005 Subject: [Wxruby-users] Wx::HtmlWindow.on_link_clicked In-Reply-To: <427C3C28.2090100@nicreations.com> References: <02859667.20050504004755@ubiz.ru> <427C3C28.2090100@nicreations.com> Message-ID: <171017923.20050507203625@ubiz.ru> Hello, Nick. You wrote 07.05.2005, 12:55:20: N> Thanks for the contributions. Thank you! :-) N> I'll try to get them in this weekend, N> though the 10 hour workdays have been prohibitive. Yes, i`m understand you very well.. N> I'm glad for all the contributions, but I'd appricate if you focused on N> the SWIG code. You don't SWIG/Rake/etc to build it - you can use the N> extconf.rb in the src directory. Well.. I have all required components, working wxwidgets 2.6, latest swig, latest ruby and rake. Problem is what i just can`t build swig version of ruby with wxwidgets 2.6. There are a lot of troubles i found. Some of troubles are strange swig behavior, some are related to interface changes between 2.4 and 2.6.. For a moment, i have no working version of wxruby-swig. By the way, how 'wxclasses-2.4.2.xml' was produced? I think what more recent file can resolve many problems automatically. Also, i see what faults in a file 'wxclasses-2.4.2.xml' are fixed in 'extractxml.rb'. But is this a good practice? I think what this makes swig version a much more difficult to maintain. -- Dmitry mailto:dmiceman@ubiz.ru From alex at pressure.to Sat May 7 08:36:28 2005 From: alex at pressure.to (Alex Fenton) Date: Sat May 7 08:30:07 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427CA9A3.1050009@qualitycode.com> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> <427CA9A3.1050009@qualitycode.com> Message-ID: <427CB64C.30300@pressure.to> Nick wrote: >>I tried building 2.6 on my Mac one night and it had multiple build >>errors. >> Yep, I just tried wxMac-2.6.0 on 10.3.9 and it didn't compile, am currently using 2.5.3. Kevin Smith wrote: > If the latter, a 2.4-only >tarball release of wxruby-swig would still be very valuable. Similarly, >pre-release tarballs on any of the platforms would encourage more testing. > > I'm happy to help provide os-x binaries and/or tarballs, especially if that would help others focus on windows. I don't know how to make binaries though, is there a guide to making .dmgs or whatever? cheers alex From joaopedrosa at gmail.com Sat May 7 08:50:43 2005 From: joaopedrosa at gmail.com (Joao Pedrosa) Date: Sat May 7 08:44:26 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427CB64C.30300@pressure.to> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> <427CA9A3.1050009@qualitycode.com> <427CB64C.30300@pressure.to> Message-ID: Hi, On 5/7/05, Alex Fenton wrote: > Nick wrote: > > >>I tried building 2.6 on my Mac one night and it had multiple build > >>errors. > >> > > Yep, I just tried wxMac-2.6.0 on 10.3.9 and it didn't compile, am > currently using 2.5.3. > > Kevin Smith wrote: > > > If the latter, a 2.4-only > >tarball release of wxruby-swig would still be very valuable. Similarly, > >pre-release tarballs on any of the platforms would encourage more testing. > > > > > I'm happy to help provide os-x binaries and/or tarballs, especially if > that would help others focus on windows. I don't know how to make > binaries though, is there a guide to making .dmgs or whatever? I seem to have been able to compile wxRuby and wxRuby-swig on Windows. Maybe with both wxWidgets 2.4.2. and 2.6. I remember, though, that once I set the SWIG environment variable, it would complain about not applying all the "fixes", and after some figuring out, I gave up on that. My point is that both are in good shape, but I couldn't _run_ wxRuby compiled with wxWidgets 2.6 as well, so I'm hoping that Nick or another developer can prepare a good release for 2.6. :-) I used the free VC++ 2003 optimizing compiler, BTW. Cheers, Joao From wxruby at qualitycode.com Sat May 7 09:18:54 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat May 7 09:12:46 2005 Subject: [Wxruby-users] wxclasses-2.4.2.xml (was: Wx::HtmlWindow.on_link_clicked) In-Reply-To: <171017923.20050507203625@ubiz.ru> References: <02859667.20050504004755@ubiz.ru> <427C3C28.2090100@nicreations.com> <171017923.20050507203625@ubiz.ru> Message-ID: <427CC03E.4070305@qualitycode.com> Dmitry Morozhnikov wrote: > By the way, how 'wxclasses-2.4.2.xml' was produced? I think what more > recent file can resolve many problems automatically. I described the process here: http://rubyforge.org/pipermail/wxruby-users/2005-February/001173.html It's hard to tell for sure, but I don't think he has updated this page, or the xml file, for at least several months. > Also, i see what faults in a file 'wxclasses-2.4.2.xml' are fixed in > 'extractxml.rb'. But is this a good practice? I think what this makes > swig version a much more difficult to maintain. In a perfect world, the wx folks would publish a full, error-free API spec. That doesn't appear to be a priority for them, so whatever we do won't be perfect. We would have exactly the same problem if we weren't using SWIG. Either way, we must create and maintain a full set of header files (or .t files as we had in wxruby 0.6) describing the API. Using the xml file allowed me to quickly create a "pretty good" set of wx header files. It appears that this process is no longer useful, and we should "fork" all the header files and start maintaining them ourselves. We could get rid of the xml file and the extractxml.rb tool, and from now on just directly update the headers. I'm not sure if we should have separate headers for 2.4 and 2.6, or if we should use #if's. I think I would prefer separating them. Kevin From wxruby at qualitycode.com Sat May 7 09:21:42 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat May 7 09:15:30 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427CB64C.30300@pressure.to> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> <427CA9A3.1050009@qualitycode.com> <427CB64C.30300@pressure.to> Message-ID: <427CC0E6.1070203@qualitycode.com> Alex Fenton wrote: > Yep, I just tried wxMac-2.6.0 on 10.3.9 and it didn't compile, am > currently using 2.5.3. You're using wx 2.5.3? Can you upgrade to the recently-released 2.6.0? If you post the first few compile errors here, we might be able to diagnose and suggest a fix/workaround. Kevin From wxruby at qualitycode.com Sat May 7 09:29:34 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat May 7 09:23:25 2005 Subject: [Wxruby-users] Making it easier to contribute wxRuby-SWIG code In-Reply-To: <4277FA9F.3020700@pressure.to> References: <4277FA9F.3020700@pressure.to> Message-ID: <427CC2BE.4010806@qualitycode.com> Alex Fenton wrote: > I've run out a quick list comparing wxruby-swig (plus a few eg > GridCellEditor) compared to wxruby 0.6.0 . It's on the wiki at the > bottom of the page at > > http://wxruby.rubyforge.org/wiki/wiki.pl?How_To_Add_A_New_Class_To_Wxruby-Swig Excellent. I just added a note mentioning that not all of the "missing" classes actually should be implemented in wxruby-swig. Several of them appear (at a glance) to duplicate functionality already present in Ruby. Whenever possible, people writing wxruby apps should use standard Ruby features rather than wx equivalents. Kevin From alex at pressure.to Sat May 7 14:05:23 2005 From: alex at pressure.to (Alex Fenton) Date: Sat May 7 13:59:10 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427CC0E6.1070203@qualitycode.com> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> <427CA9A3.1050009@qualitycode.com> <427CB64C.30300@pressure.to> <427CC0E6.1070203@qualitycode.com> Message-ID: <427D0363.9050504@pressure.to> >You're using wx 2.5.3? Can you upgrade to the recently-released 2.6.0? > > > A bit more tinkering and it worked. I needed to upgrade my Quicktime SDK libraries through Software Update. For the record, this is how this originally shows up: ./bk-deps g++ -c -o basedll_utils.o -I.pch/wxprec_basedll -D__WXMAC__ -I../src/tiff -I../src/jpeg -I../src/png -I../src/expat/lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -dynamic -fPIC -DPIC -DWX_PRECOMP -DNO_GCC_PRAGMA -Ilib/wx/include/mac-ansi-release-2.6 -I../include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -fpascal-strings -I../src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon -O2 -Wall -Wno-ctor-dtor-privacy -fno-common ../src/mac/carbon/utils.cpp ../src/mac/carbon/utils.cpp: In function `void wxBell()': ../src/mac/carbon/utils.cpp:390: error: `SysBeep' undeclared (first use this function) ../Src/mac/carbon/utils.cpp:390: error: (Each undeclared identifier is reported only once for each function it appears in.) cheers alex From devel at nicreations.com Sat May 7 22:37:10 2005 From: devel at nicreations.com (Nick) Date: Sat May 7 22:34:08 2005 Subject: [Wxruby-users] Is wxRuby-SWIG version usable enough to package for download? In-Reply-To: <427CC0E6.1070203@qualitycode.com> References: <42776BB1.6070305@pressure.to> <427C3D70.2050809@nicreations.com> <427CA9A3.1050009@qualitycode.com> <427CB64C.30300@pressure.to> <427CC0E6.1070203@qualitycode.com> Message-ID: <427D7B56.3010108@nicreations.com> Apple put out the OS X update for Quicktime 7 seperate from the SDK, so the headers got out of sync. Apparently wxWidgets 2.6 uses Quicktime, so the build failed. Nick Kevin Smith wrote: > Alex Fenton wrote: > >>Yep, I just tried wxMac-2.6.0 on 10.3.9 and it didn't compile, am >>currently using 2.5.3. > > > You're using wx 2.5.3? Can you upgrade to the recently-released 2.6.0? > > If you post the first few compile errors here, we might be able to > diagnose and suggest a fix/workaround. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From alex at pressure.to Sun May 8 10:33:07 2005 From: alex at pressure.to (Alex Fenton) Date: Sun May 8 10:26:44 2005 Subject: [Wxruby-users] ruby destructor hooks Message-ID: <427E2323.3020903@pressure.to> Hi Is there a way of finding out when or whether the wx object referenced in ruby is still alive? Here's my problem # register that +wx_control+ should update on application events of type +event_type+ def add_subscriber(wx_control, app_event_type) @subscriptions[app_event_type].push(wx_control) end # later def broadcast(app_event) @subscriptions[app_event.type].each { | subscriber | subscriber.notify(app_event) } end I have an application in which a ruby hash mapping subscribable application events (like a new document being added) to controls which should update their appearance on these events. Sometimes a control will have been closed by the user, but is still in the subscribers list. When an event is broadcast, its "notify" method is called, it gives a "pure virtual method call" error (wxruby 0.6.0). I've tried several different things to clean up the subscribers list as controls are destroyed, but without success: WeakRef ObjectSpace.define_finalizer(subscriber) subscriber.evt_close() { | e | delete_subscriber(subscriber) } The last seems to be the most promising, but it doesn't work for all the control types that can be subscribers - only for frames. Is there something universal to all Wx controls that I could try? cheers alex From wxruby at qualitycode.com Mon May 9 09:41:11 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon May 9 09:35:00 2005 Subject: [Wxruby-users] ruby destructor hooks In-Reply-To: <427E2323.3020903@pressure.to> References: <427E2323.3020903@pressure.to> Message-ID: <427F6877.30504@qualitycode.com> Alex Fenton wrote: > Hi > > Is there a way of finding out when or whether the wx object referenced > in ruby is still alive? (snip) > subscriber.evt_close() { | e | delete_subscriber(subscriber) } > > The last seems to be the most promising, but it doesn't work for all the > control types that can be subscribers - only for frames. Is there > something universal to all Wx controls that I could try? The only thing I can think of is to override the destroy method for each of the controls you want to monitor. Your implementation should remove this control from your hash, and then must return super. I think this will work in wxruby-swig, because I think it automatically allows all virtual C++ methods to be overridden in ruby. It has been long enough since I have worked with this that I could be wrong. I suspect it won't work with wxruby-0.6.0, but keep in mind that it has been even longer since I have worekd with that code base. Kevin From devel at nicreations.com Tue May 17 23:56:47 2005 From: devel at nicreations.com (Nick) Date: Tue May 17 23:53:28 2005 Subject: [Wxruby-users] Grid Message-ID: <428ABCFF.5070900@nicreations.com> I've merged in Alex's changes with the grid control into wxruby-swig. I need to make a tweak so it will build on MSW, and then prepare a preview release. I need a volunteer to make a Tiger package (I can talk you through it). Nick From alex at pressure.to Wed May 18 05:50:00 2005 From: alex at pressure.to (Alex Fenton) Date: Wed May 18 05:43:01 2005 Subject: [Wxruby-users] Grid In-Reply-To: <428ABCFF.5070900@nicreations.com> References: <428ABCFF.5070900@nicreations.com> Message-ID: <428B0FC8.3020001@pressure.to> Hi I'm using 10.3 (is that Tiger?), have the toolchain and can make a release if you talk me through it. I'll write up as a Wiki page. Do you think there's too much missing from TreeCtrl/TreeEvent for the time being - I couldn't work out if it was Wx bugginess on OS X or probs with Swig, but assumed the former? a Nick wrote: > > I've merged in Alex's changes with the grid control into wxruby-swig. > I need to make a tweak so it will build on MSW, and then prepare a > preview release. I need a volunteer to make a Tiger package (I can > talk you through it). > > Nick > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From zdennis at mktec.com Wed May 18 17:41:21 2005 From: zdennis at mktec.com (Zach Dennis) Date: Wed May 18 17:34:36 2005 Subject: [Wxruby-users] wxRuby Documentation Message-ID: <428BB681.2050106@mktec.com> I never uploaded my generated documentation or scripts to CVS... Nick, where would you like me to put my documentation generating scripts? Also, should I (and is there a way to) upload documentation to the rubyforge site? Should I contact Tom Copeland so we have updated documentation on the wxruby.rubyforge.org wiki? Also, I'm still here kicking...any area's that need assistance...? Zach From dmartenson at multitech.com Thu May 19 12:15:28 2005 From: dmartenson at multitech.com (Dale Martenson) Date: Thu May 19 12:08:48 2005 Subject: [Wxruby-users] Problems installing wxRuby on Mac OS X 10.3.9 Message-ID: <428CBBA0.1080400@multitech.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20050519/292ec0cd/attachment.htm From devel at nicreations.com Tue May 24 00:09:35 2005 From: devel at nicreations.com (Nick) Date: Tue May 24 00:06:06 2005 Subject: [Wxruby-users] Problems installing wxRuby on Mac OS X 10.3.9 In-Reply-To: <428CBBA0.1080400@multitech.com> References: <428CBBA0.1080400@multitech.com> Message-ID: <4292A8FF.8070707@nicreations.com> 1) Which release did you download? 2) Which version of ruby fo you have? Nick Dale Martenson wrote: > I tried to install wxRuby on my Mac, but I get the following error. > > *g++ -fno-common -g -O2 -pipe -fno-common `wx-config --cxxflags` -I. > -I/usr/local/lib/ruby/1.8/powerpc-darwin7.9.0 > -I/usr/local/lib/ruby/1.8/powerpc-darwin7.9.0 -I. -x objective-c++ -c > htmleasyprinting.cpp > htmleasyprinting.cpp: In static member function `static VALUE > WxHtmlEasyPrinting::PrinterSetup(int, VALUE*, long unsigned int)': > htmleasyprinting.cpp:181: error: `PrinterSetup' undeclared (first use this > function) > htmleasyprinting.cpp:181: error: (Each undeclared identifier is reported > only > once for each function it appears in.) > make: *** [htmleasyprinting.o] Error 1 * > > > I have previously installed wxMac-2.4.2 from www.wxwidgets.org > . Is this caused by something not being > included in the wxMac installation? Or some library missing from my system? > > Any advice appreciated. > > --Dale > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users