In Files

Parent

Methods

Files

Rumix::Widget::OptionPanel

Public Class Methods

new(parent, items) click to toggle source

(Not documented)

# File rumix/wx.rb, line 67
                        def initialize(parent, items)
                                super(parent)
                                
                                construct_children do |panel|
                                        # ラジオグループ全体を入れるSizer
                                        topsz = vbox_sizer do
                                                vertical_border 8
                                                expand
                                                items.each_with_index do |item, i|
                                                        # 各ラジオボタンの関連パーツをまとめるSizer
                                                        vbox_sizer do
                                                                expand
                                                                widget panel.option_widget_class, :name => item.name, :label => item.label, :style => (i == 0 ? Wx::RB_GROUP : 0) do |widget|
                                                                        widget.value = item.selected
                                                                end
                        
                                                                if item.description then
                                                                        # 付帯情報領域と左マージンを含んだSizer
                                                                        hbox_sizer do
                                                                                stretch_spacer 1
                                                                                proportion 11
                                                                                # 付帯情報領域のSizer
                                                                                static_vbox_sizer('') do
                                                                                        widget Wx::StaticText, :label => item.description do |text|
                                                                                                text.name = item.options[:description_name] if item.options[:description_name]
                                                                                        end
                                                                                        
                                                                                        if item.options[:path_name] then
                                                                                                expand
                                                                                                hbox_sizer do
                                                                                                        border 4
                                                                                                        proportion 1
                                                                                                        widget Wx::TextCtrl, :name => (item.options[:path_name] + '_text'), :value => item.options[:path_default]
                                                                                                        proportion 0
                                                                                                        widget Wx::Button, :label => '参照', :name => (item.options[:path_name] + '_button') do |button|
                                                                                                                panel.evt_button(button, :on_select_dir)
                                                                                                        end # widget
                                                                                                end # sizer
                                                                                        end # if
                                                                                end # static_vbox_sizer
                                                                                
                                                                        end # hbox_sizer
                                                                end # if item.description
                                                        end # vbox_sizer
                                                end # items.each_with_index
                                        end # topsz
                                        
                                        topsz.fit(panel)
                                                        
                                end
                        end

Public Instance Methods

on_select_dir(evt) click to toggle source

(Not documented)

# File rumix/wx.rb, line 119
                        def on_select_dir(evt)
                                text = find_window_by_name(evt.event_object.name.sub(/_button$/, '_text'))
                                dialog = Wx::DirDialog.new(self, :default_path => text.value)
                                if dialog.show_modal == Wx::ID_OK then
                                        text.value = dialog.path
                                end
                                
                        end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.