Class: Wx::SF::DetachedContentCtrl
- Inherits:
-
Dialog
- Object
- Dialog
- Wx::SF::DetachedContentCtrl
- Defined in:
- lib/wx/shapes/shapes/edit_text_shape.rb
Overview
Auxiliary class providing necessary functionality needed for dialog-based modification of a content of the text shape.
Instance Method Summary collapse
-
#get_content ⇒ String
Get content of dialog’s text edit control.
-
#initialize(parent, id = Wx::ID_ANY, title = 'Edit content', pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::DEFAULT_DIALOG_STYLE|Wx::RESIZE_BORDER) ⇒ DetachedContentCtrl
constructor
A new instance of DetachedContentCtrl.
-
#set_content(txt) ⇒ Object
Set content of dialog’s text edit control.
Constructor Details
#initialize(parent, id = Wx::ID_ANY, title = 'Edit content', pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::DEFAULT_DIALOG_STYLE|Wx::RESIZE_BORDER) ⇒ DetachedContentCtrl
Returns a new instance of DetachedContentCtrl.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/wx/shapes/shapes/edit_text_shape.rb', line 110 def initialize(parent, id = Wx::ID_ANY, title = 'Edit content', pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::DEFAULT_DIALOG_STYLE|Wx::RESIZE_BORDER) set_size_hints(Wx::Size.new(-1,-1), Wx::DEFAULT_SIZE) main_sizer = Wx::VBoxSizer.new @text = Wx::TextCtrl.new(self, Wx::ID_ANY, '', Wx::DEFAULT_POSITION, [350,100], Wx::TE_MULTILINE) @text.set_min_size([350,100]) main_sizer.add(@text, 1, Wx::ALL|Wx::EXPAND, 5) = Wx::StdDialogButtonSizer.new = Wx::Button.new(self, Wx::ID_OK) .() = Wx::Button.new(self, Wx::ID_CANCEL) .() .realize main_sizer.add(, 0, Wx::ALIGN_RIGHT|Wx::BOTTOM|Wx::RIGHT, 5) set_sizer(main_sizer) layout main_sizer.fit(self) centre(Wx::BOTH) end |
Instance Method Details
#get_content ⇒ String
Get content of dialog’s text edit control.
145 146 147 |
# File 'lib/wx/shapes/shapes/edit_text_shape.rb', line 145 def get_content @text.get_value end |
#set_content(txt) ⇒ Object
Set content of dialog’s text edit control.
139 140 141 |
# File 'lib/wx/shapes/shapes/edit_text_shape.rb', line 139 def set_content(txt) @text.set_value(txt) end |