Class: Watobo::Gui::CheckBoxTreeItem
- Inherits:
-
FXTreeItem
- Object
- FXTreeItem
- Watobo::Gui::CheckBoxTreeItem
- Includes:
- Icons
- Defined in:
- lib/watobo/gui/checkboxtree.rb
Constant Summary
Constants included from Icons
Icons::ICON_ADD_PROJECT, Icons::ICON_BROWSER_MEDIUM, Icons::ICON_BROWSER_SMALL, Icons::ICON_BTN_DOWN, Icons::ICON_BTN_UP, Icons::ICON_CB_CHECKED, Icons::ICON_CB_CHECKED_ORANGE, Icons::ICON_CB_UNCHECKED, Icons::ICON_CONVERSATION, Icons::ICON_DASHBOARD, Icons::ICON_DIFFER, Icons::ICON_FOLDER, Icons::ICON_FOLDER_SMALL, Icons::ICON_FUZZER, Icons::ICON_FUZZER_MEDIUM, Icons::ICON_FUZZER_SMALL, Icons::ICON_FUZZ_FILTER, Icons::ICON_FUZZ_GENERATOR, Icons::ICON_FUZZ_TAG, Icons::ICON_HINTS, Icons::ICON_HINTS_INFO, Icons::ICON_HINTS_INFO_SMALL, Icons::ICON_HINTS_SMALL, Icons::ICON_INFO, Icons::ICON_INFO_INFO, Icons::ICON_INFO_INFO_SMALL, Icons::ICON_INFO_SMALL, Icons::ICON_INFO_USER, Icons::ICON_INFO_USER_SMALL, Icons::ICON_INTERCEPTOR, Icons::ICON_LOGIN_WIZZARD, Icons::ICON_MANUAL_REQUEST, Icons::ICON_MANUAL_REQUEST_MEDIUM, Icons::ICON_MANUAL_REQUEST_SMALL, Icons::ICON_PAUSE, Icons::ICON_PLUGIN, Icons::ICON_PROJECT, Icons::ICON_PROJECT_SMALL, Icons::ICON_REPORT, Icons::ICON_REQUEST, Icons::ICON_REQUEST_SMALL, Icons::ICON_SEND_REQUEST, Icons::ICON_SITE, Icons::ICON_SITE_SMALL, Icons::ICON_START, Icons::ICON_STOP, Icons::ICON_TOKEN, Icons::ICON_TRANSCODER, Icons::ICON_VULN, Icons::ICON_VULN_BP, Icons::ICON_VULN_BP_SMALL, Icons::ICON_VULN_CRITICAL, Icons::ICON_VULN_CRITICAL_SMALL, Icons::ICON_VULN_HIGH, Icons::ICON_VULN_HIGH_SMALL, Icons::ICON_VULN_LOW, Icons::ICON_VULN_LOW_SMALL, Icons::ICON_VULN_MEDIUM, Icons::ICON_VULN_MEDIUM_SMALL, Icons::ICON_VULN_SMALL, Icons::ICON_WATOBO, Icons::SIBERAS_ICON, Icons::TBL_ICON_LOCK, Icons::WATOBO_LOGO
Instance Attribute Summary collapse
-
#checked ⇒ Object
Returns the value of attribute checked.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(item_text, item_status, item_data) ⇒ CheckBoxTreeItem
constructor
A new instance of CheckBoxTreeItem.
- #toggle ⇒ Object
- #uncheck ⇒ Object
Constructor Details
#initialize(item_text, item_status, item_data) ⇒ CheckBoxTreeItem
Returns a new instance of CheckBoxTreeItem.
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/watobo/gui/checkboxtree.rb', line 73 def initialize(item_text, item_status, item_data) super item_text @checked = item_status #icon = ICON_CB_CHECKED #icon = ICON_CB_UNCHECKED if not status #super(text, icon, icon, data) # data = item_data if @checked check else uncheck end end |
Instance Attribute Details
#checked ⇒ Object
Returns the value of attribute checked.
40 41 42 |
# File 'lib/watobo/gui/checkboxtree.rb', line 40 def checked @checked end |
Instance Method Details
#check ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/watobo/gui/checkboxtree.rb', line 43 def check begin @checked = true self.setOpenIcon(ICON_CB_CHECKED) self.setClosedIcon(ICON_CB_CHECKED) # opened = true rescue => bang puts "!!!ERROR: could not uncheck item" end end |
#toggle ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/watobo/gui/checkboxtree.rb', line 65 def toggle if @checked uncheck else check end end |
#uncheck ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/watobo/gui/checkboxtree.rb', line 54 def uncheck begin @checked = false self.setOpenIcon(ICON_CB_UNCHECKED) self.setClosedIcon(ICON_CB_UNCHECKED) #opened = false rescue => bang puts "!!!ERROR: could not uncheck item" end end |