Class Ui::WxWidgets::Dialogs::NoteDialog
In: ui/wx/dialogs/note.rb
Parent: Wx::Dialog

Methods

author   categories=   category   edit_note   new   text  

Included Modules

NoteDialogInterface

Public Class methods

=============================================== public methods

[Source]

    # 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

Public Instance methods

[Source]

    # File ui/wx/dialogs/note.rb, line 70
70:         def author() 
71:           @author.get_value
72:         end

[Source]

    # 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

[Source]

    # File ui/wx/dialogs/note.rb, line 73
73:         def category() 
74:           @category.get_value
75:         end

[Source]

    # File ui/wx/dialogs/note.rb, line 88
88:         def edit_note(note)
89:           @author.set_value(note.author)
90:           @text.set_value(note.text)
91:           @category.set_value(note.category)
92:         end

[Source]

    # File ui/wx/dialogs/note.rb, line 76
76:         def text() 
77:           @text.get_value
78:         end

[Validate]