search for: is_checked

Displaying 8 results from an estimated 8 matches for "is_checked".

2006 May 05
0
is this good for a conditional checkbox?
...ve a conditional that decides whether the checkbox is checked or unchecked. being new to this, i just did it the only way i could think of and want to see if there''s a better way of accomplishing it. <% selected_app = @user.apps.detect{ |app| app.id == app_line.id } if selected_app is_checked = ''checked'' else is_checked = nil end -%> <tr> <td><%= app_line.name %></td> <td><%= check_box ''add_app'', app_line.id, { :checked => is_checked }, ''yes'', ''no'' %></td> </tr&...
2006 Nov 04
0
[720] trunk/wxruby2/doc/textile/menu.txtl: Update, rubyify and tidy
...ormal items -don''t have any special properties while the check items have a boolean flag -associated to them and they show a checkmark in the menu when the flag is set. -Widgets automatically toggles the flag value when the item is clicked and its -value may be retrieved using either "is_checked":#Menu_ischecked method -of Menu or MenuBar itself or by using -"Event#is_checked":event.html#Event_ischecked when you get the menu -notification for the item in question. </del><ins>+h2. Types of menu item </ins><span class="cx"> </span><...
2007 Sep 20
7
Troubles with ListBox and CheckListBox events
Hi all, Here is an excerpt of code (with the new syntax from upcoming wxRuby 1.9.2) : evt_checklistbox(my_checklist, :on_checklistbox) evt_listbox(my_checklist, :on_listbox) evt_listbox(my_list, :on_listbox) def on_checklistbox(event) checklist = event.event_object # puts "listbox - event : item[#{event.int}] checked : #{event.checked?}" puts "listbox -
2007 Feb 27
2
Dynamically add radio buttons to forms?
...er the appropriate partial tha contains the radio options. All works nicely but I''m tripped up on one thing: When rendering a form using form_for how do I link those radio buttons to the form? In the partial I have: <%= form.radio_button( :product_id, thumbnail.id, :checked => is_checked ) %> but obviously since the HTML is being rendered via the partial after the form has been created there''s no form object to use to build the radio_button. My questions: is there a way to pass the form object? Am I doing this completely wrong? Many thanks Chris --~--~---------~--~...
2006 Sep 11
15
ruby method names
...ve textctrl.get_value # currently textctrl.value # now an alternative Also, C++ methods named ''IsXXX'' are now exposed in ruby with the alternative name ''xxx?'', eg tree_item_id.is_ok # currently tree_item_id.ok? # now an alternative a_checkbox.is_checked a_checkbox.checked? Note these are simply aliases - existing code can remain unchanged. I think this would do a lot to make the API feel more ruby-like (or pythonesque - WxPython follows this style) - but is pretty cheap and straightforward. There is no speed hit, and the resulting binary is...
2006 Mar 31
7
Checkboxes expand to show new options when checked?
...s %> <div id="subcategories"> <input type="checkbox" /DITTO> <%= subcategory.name %> </div <% end %> <% end %> Is there some kind of conditional I can put before the second "for" statement? An is_checked? sort of thing? Or maybe AJAX using Element.toggle? I don''t know where to start - and a web search didn''t do much good. Thanks, Adam -- Posted via http://www.ruby-forum.com/.
2006 Sep 14
2
Patch to fix ArtProvider and ArtProvider sample
These patches better implement ArtProvider and add the demo for it. I also expanded the bigdemo window a little bit. I really think we should go larger but I suppose there might be some people at 800x600 still. Note that creating your own art provider still doesn''t quite work correctly. I didn''t have time to get into that. The RubyConstants.i.patch file looks weird. Not
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.
...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="cx"&g...