| Class | Ui::WxWidgets::Dialogs::NoteDialog |
| In: |
ui/wx/dialogs/note.rb
|
| Parent: | Wx::Dialog |
# File ui/wx/dialogs/note.rb, line 34
34: def initialize(parent=nil)
35: super()
36:
37: # TODO: think about a way of sharing this XmlResource between
38: # different wx components
39: xml = Wx::XmlResource.get();
40: xml.init_all_handlers();
41: xml.load("ui/wx/dialogs/note.xrc")
42:
43: #
44: # Load the dialog from XRC. We define $xml in on_init.
45: # We could use XmlResource.get() over and over again, but
46: # honestly, thats just too much work.
47: #
48: xml.load_dialog_subclass(self,parent,'ID_NOTEDIALOG')
49:
50: #
51: # Get the buttons. Note we use 'xrcid' much like the XRCID macro
52: # in C++. Make sure the id's actually exist, or your program will crash!
53: #
54: @author = Wx::Window.find_window_by_id(Wx::xrcid('ID_AUTHOR'),self)
55: @category = Wx::Window.find_window_by_id(Wx::xrcid('ID_CATEGORY'),self)
56: @text = Wx::Window.find_window_by_id(Wx::xrcid('ID_TEXT'),self)
57:
58: #
59: # Bind the buttons to event handlers
60: #
61: evt_button(Wx::xrcid('wxID_OK')) do
62: end_modal(Wx::ID_OK)
63: end
64:
65: evt_button(Wx::xrcid('wxID_CANCEL')) do
66: end_modal(Wx::ID_CANCEL)
67: end
68: end
# File ui/wx/dialogs/note.rb, line 80
80: def categories=(category_list)
81: @category.clear
82: category_list.each do |c|
83: @category.append c.name
84: end
85: @category.set_selection(0)
86: end