search for: menu_bar

Displaying 20 results from an estimated 20 matches for "menu_bar".

2007 Jul 21
0
[1135] trunk/wxruby2/swig/mark_free_impl.i: Convert from DOS to Unix newlines
...l accessible on screen, -// because it may still handle events. Rather than a SWIG %markfunc, -// which can catch destroyed MenuBars linked to an in-scope ruby -// variable and cause segfaults, MenuBars are always marked via the -// containing Frame. -void GC_mark_MenuBarBelongingToFrame(wxMenuBar *menu_bar) -{ - rb_gc_mark( SWIG_RubyInstanceFor(menu_bar) ); - // Mark each menu in the menubar in turn - for ( int i = 0; i < menu_bar->GetMenuCount(); i++ ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp...
2007 Jul 21
0
[1127] trunk/wxruby2: Move shared C++ GC functions into separate file included into wx.i
...l accessible on screen, +// because it may still handle events. Rather than a SWIG %markfunc, +// which can catch destroyed MenuBars linked to an in-scope ruby +// variable and cause segfaults, MenuBars are always marked via the +// containing Frame. +void GC_mark_MenuBarBelongingToFrame(wxMenuBar *menu_bar) +{ + rb_gc_mark( SWIG_RubyInstanceFor(menu_bar) ); + // Mark each menu in the menubar in turn + for ( int i = 0; i < menu_bar->GetMenuCount(); i++ ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp...
2007 Nov 18
2
Issues adding sub-menu items
...the event the program fails. What do I need to do or what I''m I missing. I appreciate your response. Thanks, Glenn #!/usr/bin/env ruby begin .... .... .... class HL7Query < Wx::Frame def initialize(title) super(nil, :title => title, :size => [ 850, 600 ]) menu_bar = Wx::MenuBar.new # The "file" menu menu_file = Wx::Menu.new menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program") menu_bar.append(menu_file, "&File") # The "Tools" menu menu_tools = Wx::Menu.new #m...
2007 Jul 05
0
[1109] trunk/wxruby2/swig: Move marking of MenuBar from direct %markfunc to via mark_wxFrame, so
...ecause it -// may be required to handle events. -%{ -void mark_wxMenuBar(void *ptr) -{ - VALUE rb_win = SWIG_RubyInstanceFor(ptr); - if ( rb_iv_get(rb_win, "@__wx_destroyed__") == Qtrue ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return; - - wxMenuBar* menu_bar = (wxMenuBar*)ptr; - // Mark each menu in the menubar in turn - for ( int i = 0; i < menu_bar->GetMenuCount(); i++ ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp wxMenu* menu = menu_bar...
2008 Jan 04
2
problem with Menu.append_check_item()
...require ''rubygems'' load ''wx'' rescue raise no_wx_err end end include Wx class MinimalFrame < Wx::Frame def initialize(title) # The main application frame has no parent (nil) super(nil, :title => title, :size => [ 700, 400 ]) menu_bar = Wx::MenuBar.new menu_file = Wx::Menu.new item1 = menu_file.append(1000, "Test Item 1") item2 = menu_file.append_check_item(1001, "Test Checked Item") puts item1 puts item2 menu_bar.append(menu_file, "Test1") self.menu_bar = menu_bar...
2006 Sep 17
1
run.rb
This is a first stab at a run.rb file that will let you run a sample in the bigdemo directory by itself. You have to add the following to the bottom of every sample file: if __FILE__ == $0 load "run.rb" run(File.basename($0)) end Roy _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org
2006 Apr 27
5
Major Breakthrough?
Attached are patches to make the textctrl.rb sample work fully. Note the new %directorargout typemap I added to fix wxWindows calling into SWIG. I don''t know if this can fix all such problems or not. Let me know what you think. I also rubified the sample a little bit more. Also, note that I fix the << operator so the function can be called. I hope I did this right. Roy
2007 Mar 20
0
[903] branches/wxruby2/wxwidgets_282/samples: Added #!/usr/bin/env ruby to the grid sample.
...} - sel_menu.append(1004, ''Select column 4'', ''Select col 4'') - evt_menu(1004) { @grid.select_col(3) } - sel_menu.append(1005, ''Select block'', ''Select block'') - evt_menu(1005) { @grid.select_block(1, 1, 6, 3) } - menu_bar = Wx::MenuBar.new - menu_bar.append(sel_menu, ''Select'') - set_menu_bar(menu_bar) - - make_grid(self) - sizer.add(@grid, 1, Wx::ALL|Wx::GROW, 4) - set_sizer(sizer) - - evt_grid_cell_left_click() do |evt| - set_status_text("#{evt.get_row} x #{evt.get_col}...
2007 Sep 05
6
centering MessageDialog
Hi, is there any way to center the default Wx::MessageDialog or Wx::message_box on parent (owner) instead of screen? I haven''t found any constant other than Wx::DEFAULT_POSITION. thanks for your help. fabio. _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2007 May 22
0
[1029] trunk/wxruby2/swig/classes/MenuBar.i: Add special GC protection for Wx::Menu to prevent premature destruction
...Bar(void *ptr) +{ + VALUE rb_win = SWIG_RubyInstanceFor(ptr); + if ( rb_iv_get(rb_win, "@__wx_destroyed__") == Qtrue ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return; </ins><span class="cx"> </span><ins>+ wxMenuBar* menu_bar = (wxMenuBar*)ptr; + // Mark each menu in the menubar in turn + for ( int i = 0; i < menu_bar->GetMenuCount(); i++ ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp wxMenu* menu = menu_bar...
2004 Aug 25
7
problem subclassing Wx::Menu
...50, 400, 200) # @menu_foo = Wx::Menu.new() # @menu_foo.append(999, "&Qux\tCtrl-Q") # frame.evt_menu(999) { | e | p "QUX" } @menu_foo = EasyMenu.new(frame) @menu_foo.add_menu_item("&Qux", "Ctrl-Q") { | e | p "QUX" } menu_bar = Wx::MenuBar.new() menu_bar.append(@menu_foo, "&Foo") frame.set_menu_bar(menu_bar) frame.show(TRUE) end end MyApp.new.main_loop()
2007 Sep 27
10
Adding more sugar to wxSugar
...;, :size => [ 400, 300 ]) do menu_file = Wx::Menu.new() menu_help = Wx::Menu.new() menu_help.append(Wx::ID_ABOUT, "&About...\tF1", "Show about dialog") menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program") menu_bar = Wx::MenuBar.new() menu_bar.append(menu_file, "&File") menu_bar.append(menu_help, "&Help") set_menu_bar(menu_bar) create_status_bar(2) set_status_text("Welcome to wxRuby!") evt_menu Wx::ID_EXIT, :on_quit evt_menu Wx:...
2007 Feb 14
0
[875] trunk/wxruby2/samples: Add expanded grid sample
...} + sel_menu.append(1004, ''Select column 4'', ''Select col 4'') + evt_menu(1004) { @grid.select_col(3) } + sel_menu.append(1005, ''Select block'', ''Select block'') + evt_menu(1005) { @grid.select_block(1, 1, 6, 3) } + menu_bar = Wx::MenuBar.new + menu_bar.append(sel_menu, ''Select'') + set_menu_bar(menu_bar) + + make_grid(self) + sizer.add(@grid, 1, Wx::ALL|Wx::GROW, 4) + set_sizer(sizer) + + evt_grid_cell_left_click() do |evt| + set_status_text("#{evt.get_row} x #{evt.get_col}...
2009 Jan 05
8
How to use evt_update_ui wrt RichTextCtrl ?
Hi, I''m trying to create a very simple RichTextCtrl sample based on the C++ version. This works pretty well now with the fixes for missing RichTextCtrl.selection_bold? ... methods. See the attached script. Given the formatting buttons (bold, italics, underlined), I can type text with the proper formatting, select some text and apply a formatting later ... The problem I have is I
2009 Jan 05
8
How to use evt_update_ui wrt RichTextCtrl ?
Hi, I''m trying to create a very simple RichTextCtrl sample based on the C++ version. This works pretty well now with the fixes for missing RichTextCtrl.selection_bold? ... methods. See the attached script. Given the formatting buttons (bold, italics, underlined), I can type text with the proper formatting, select some text and apply a formatting later ... The problem I have is I
2007 Jul 21
0
[1134] trunk/wxruby2/swig/mark_free_impl.i: When window is deleted, unhook ruby obj from DATA_PTR to avoid MSW crashes
...t; if ( GC_IsWindowDeleted(ptr) ) return; </span><span class="cx"> </span><span class="cx"> wxWindow* wx_win = (wxWindow*)ptr; </span><span class="lines">@@ -130,4 +132,25 @@ </span><span class="cx"> if ( menu_bar ) </span><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ GC_mark_MenuBarBelongingToFrame(menu_bar); } </span><span class="cx"> } </span><ins>+ +// Prevents Ruby''s GC sweeping up items that...
2006 Nov 06
3
HtmlWindow and friends
Hi Attached is a patch to add HtmlWindow and some of its friends, including HtmlEasyPrinting. Also a sample. I haven''t tried exposing the parsing and rendering API yet to allow custom tags etc - I just wanted to get basic HTML and the 0.6.0 compatibility classes first. There may well be some quite easy classes left. There''s one ugly kludge to get OnOpeningURL to compile -
2006 Nov 12
0
[724] trunk/wxruby2: Initial commit of HtmlWindow functionality
...ID_PRINT, "&Print...\tCtrl-P", "Print") + + menu_file.append(Wx::ID_PREVIEW, "&Preview...\tCtrl-Shift-P", + "Print Preview") + menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit this program") + + menu_bar = Wx::MenuBar.new() + menu_bar.append(menu_file, "&File") + menu_bar.append(menu_help, "&Help") + # Assign the menus to this frame + set_menu_bar(menu_bar) + # handle menu events + evt_menu(Wx::ID_OPEN) { on_open_file } + evt_menu(Wx::ID_PRINT) { on_...
2006 Nov 13
7
[736] trunk/wxruby2/samples/dialogs/dialogs.rb: Fixed crashing bug in on_paint and made the code style more Ruby like.
...x"> dlg.show_modal() </span><span class="cx"> end </span><span class="cx"> </span><del>- def onModelessDlg(event) </del><ins>+ def on_modeless_dlg(event) </ins><span class="cx"> show = get_menu_bar().is_checked(event.get_id()) </span><span class="cx"> if show </span><del>- if !@m_dialog - @m_dialog = MyModelessDialog.new(self) </del><ins>+ if !@dialog + @dialog = MyModelessDialog.new(self) </ins><span class=&qu...
2006 Oct 17
0
[680] trunk/wxruby2/samples/printing/printing.rb: Cleaned up to use the Ruby naming convention, added #! line, now uses Wx default ID''s in standard menu items.
...u.append(WXPRINT_ABOUT, "&About", "About this demo") </del><ins>+ help_menu.append(WXPRINT_ABOUT, "&About","About this demo") </ins><span class="cx"> </span><span class="cx"> menu_bar = Wx::MenuBar.new </span><span class="cx"> </span><span class="lines">@@ -463,7 +460,6 @@ </span><span class="cx"> </span><span class="cx"> @frame.set_status_text("Printing demo") </span>&l...