Class: Win32::VirtualDesktop::SetScreenName
- Inherits:
-
VRModalDialog
- Object
- VRModalDialog
- Win32::VirtualDesktop::SetScreenName
- Includes:
- VRCenterFeasible, VRKey_CREscFeasible, VRLayout
- Defined in:
- lib/Win32/VirtualDesktop.rb
Constant Summary collapse
- DEFAULT_FONT =
VRLocalScreen.factory.newfont("Arial",14)
- LABEL_H =
20
- LABEL_W =
100
- EDIT_H =
20
- EDIT_W =
100
- BUTTON_W =
70
- BUTTON_H =
25
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #cancelbutton_clicked ⇒ Object
- #construct ⇒ Object
- #exinit(name) ⇒ Object
- #okbutton_clicked ⇒ Object
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
25 26 27 |
# File 'lib/Win32/VirtualDesktop.rb', line 25 def name @name end |
Instance Method Details
#cancelbutton_clicked ⇒ Object
74 75 76 |
# File 'lib/Win32/VirtualDesktop.rb', line 74 def self.close(VRDialogComponent::IDCANCEL) end |
#construct ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/Win32/VirtualDesktop.rb', line 41 def construct self. = "Set Desktop Name" v_frame = Layout::VertLayoutFrame.new(nil,{Layout::SPACING=>10}) do |vf| # For the date input Layout::HorzLayoutFrame.new(vf, {Layout::SPACING=>5}) do |hf| hf.addcontrol(self, Layout::Dimensions.new(LABEL_W,LABEL_H), VRStatic, "static", "Screen Name:", 0) hf.addcontrol(self, Layout::Dimensions.new(EDIT_W,EDIT_H), VREdit, "name_edit", @name, WStyle::WS_TABSTOP) end Layout::HorzLayoutFrame.new(vf, {Layout::SPACING=>5}) do |hf| hf.addcontrol(self, Layout::Dimensions.new(BUTTON_W,BUTTON_H), VRButton, "okbutton", "Ok", WStyle::WS_TABSTOP) hf.addcontrol(self, Layout::Dimensions.new(BUTTON_W,BUTTON_H), VRButton, "cancelbutton", "Cancel", WStyle::WS_TABSTOP) end end v_frame.layout(0,0, v_frame.dimensions.min_width, v_frame.dimensions.min_height) @name_edit.text = @name if self.kind_of?(VRDialogComponent) then setButtonAs(@okbutton, VRDialogComponent::IDOK) setButtonAs(@cancelbutton, VRDialogComponent::IDCANCEL) end w, h = self.set_client_size(v_frame, v_frame.dimensions.min_width, v_frame.dimensions.min_height, 10) center(@creator, w, h) end |
#exinit(name) ⇒ Object
36 37 38 39 |
# File 'lib/Win32/VirtualDesktop.rb', line 36 def exinit(name) @name = name self end |
#okbutton_clicked ⇒ Object
69 70 71 72 |
# File 'lib/Win32/VirtualDesktop.rb', line 69 def @name = @name_edit.text self.close(VRDialogComponent::IDOK) end |