Class: Watobo::Plugin::WShell::Gui
- Inherits:
-
Watobo::PluginGui
- Object
- FXDialogBox
- Watobo::PluginGui
- Watobo::Plugin::WShell::Gui
- Defined in:
- plugins/wshell/gui/main.rb
Constant Summary
Constants included from Gui::Icons
Gui::Icons::ICON_ADD_PROJECT, Gui::Icons::ICON_BROWSER_MEDIUM, Gui::Icons::ICON_BROWSER_SMALL, Gui::Icons::ICON_BTN_DOWN, Gui::Icons::ICON_BTN_UP, Gui::Icons::ICON_CB_CHECKED, Gui::Icons::ICON_CB_CHECKED_ORANGE, Gui::Icons::ICON_CB_UNCHECKED, Gui::Icons::ICON_CONVERSATION, Gui::Icons::ICON_DASHBOARD, Gui::Icons::ICON_DIFFER, Gui::Icons::ICON_FOLDER, Gui::Icons::ICON_FOLDER_SMALL, Gui::Icons::ICON_FUZZER, Gui::Icons::ICON_FUZZER_MEDIUM, Gui::Icons::ICON_FUZZER_SMALL, Gui::Icons::ICON_FUZZ_FILTER, Gui::Icons::ICON_FUZZ_GENERATOR, Gui::Icons::ICON_FUZZ_TAG, Gui::Icons::ICON_HINTS, Gui::Icons::ICON_HINTS_INFO, Gui::Icons::ICON_HINTS_INFO_SMALL, Gui::Icons::ICON_HINTS_SMALL, Gui::Icons::ICON_INFO, Gui::Icons::ICON_INFO_INFO, Gui::Icons::ICON_INFO_INFO_SMALL, Gui::Icons::ICON_INFO_SMALL, Gui::Icons::ICON_INFO_USER, Gui::Icons::ICON_INFO_USER_SMALL, Gui::Icons::ICON_INTERCEPTOR, Gui::Icons::ICON_LOGIN_WIZZARD, Gui::Icons::ICON_MANUAL_REQUEST, Gui::Icons::ICON_MANUAL_REQUEST_MEDIUM, Gui::Icons::ICON_MANUAL_REQUEST_SMALL, Gui::Icons::ICON_PAUSE, Gui::Icons::ICON_PLUGIN, Gui::Icons::ICON_PROJECT, Gui::Icons::ICON_PROJECT_SMALL, Gui::Icons::ICON_REPORT, Gui::Icons::ICON_REQUEST, Gui::Icons::ICON_REQUEST_SMALL, Gui::Icons::ICON_SEND_REQUEST, Gui::Icons::ICON_SITE, Gui::Icons::ICON_SITE_SMALL, Gui::Icons::ICON_START, Gui::Icons::ICON_STOP, Gui::Icons::ICON_TOKEN, Gui::Icons::ICON_TRANSCODER, Gui::Icons::ICON_VULN, Gui::Icons::ICON_VULN_BP, Gui::Icons::ICON_VULN_BP_SMALL, Gui::Icons::ICON_VULN_CRITICAL, Gui::Icons::ICON_VULN_CRITICAL_SMALL, Gui::Icons::ICON_VULN_HIGH, Gui::Icons::ICON_VULN_HIGH_SMALL, Gui::Icons::ICON_VULN_LOW, Gui::Icons::ICON_VULN_LOW_SMALL, Gui::Icons::ICON_VULN_MEDIUM, Gui::Icons::ICON_VULN_MEDIUM_SMALL, Gui::Icons::ICON_VULN_SMALL, Gui::Icons::ICON_WATOBO, Gui::Icons::SIBERAS_ICON, Gui::Icons::TBL_ICON_LOCK, Gui::Icons::WATOBO_LOGO
Constants included from Gui
Gui::DIFF_TYPE_NEW, Gui::DIFF_TYPE_ORIG, Gui::SEL_TYPE_GREP, Gui::SEL_TYPE_HIGHLIGHT, Gui::TABLE_COL_COMMENT, Gui::TABLE_COL_COOKIE, Gui::TABLE_COL_HOST, Gui::TABLE_COL_METHOD, Gui::TABLE_COL_PARMS, Gui::TABLE_COL_PATH, Gui::TABLE_COL_SSL, Gui::TABLE_COL_STATUS
Constants included from Diff::LCS
Diff::LCS::BalancedCallbacks, Diff::LCS::PATCH_MAP, Diff::LCS::SequenceCallbacks, Diff::LCS::VERSION
Instance Method Summary collapse
-
#initialize ⇒ Gui
constructor
A new instance of Gui.
Methods included from Diff::LCS
LCS, __diff_direction, __inverse_vector, __lcs, __normalize_patchset, __position_hash, __replace_next_larger, diff, #diff, #lcs, patch, #patch, #patch!, patch!, sdiff, #sdiff, traverse_balanced, #traverse_balanced, traverse_sequences, #traverse_sequences, #unpatch, #unpatch!, unpatch!
Constructor Details
#initialize ⇒ Gui
Returns a new instance of Gui.
30 31 32 33 34 35 36 37 38 39 40 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'plugins/wshell/gui/main.rb', line 30 def initialize() super() @history_pos = 0 hs_green = FXHiliteStyle.new # hs_green.normalForeColor = FXRGBA(255,255,255,255) # hs_green.normalForeColor = FXRGBA(0,255,0,1) #hs_green.normalBackColor = FXRGBA(0,255,0,1) hs_green.style = FXText::STYLE_BOLD hs_red = FXHiliteStyle.new hs_red.normalForeColor = FXRGBA(255,0,0,1) #hs_red.normalBackColor = FXRGBA(255,0,0,1) hs_red.style = FXText::STYLE_BOLD frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) output_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0) @output = FXText.new(output_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) @output.editable = false @output.styled = true #@font = FXFont.new(getApp(), "courier", 12, FONTWEIGHT_BOLD) @output.setFont(FXFont.new(getApp(), "courier", 10, FONTSLANT_ITALIC, FONTENCODING_DEFAULT)) @output.hiliteStyles = [ hs_red, hs_green] @output.appendStyledText Watobo::Plugin::WShell::HELP_TEXT, 2 FXLabel.new(frame, "Enter 'help' for more information.") cmd_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X) @cmd = FXTextField.new(cmd_frame, 25, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_LEFT) @cmd.connect(SEL_COMMAND){ run_cmd } @cmd.connect(SEL_KEYPRESS) do |sender, sel, event| fin = false if event.code == KEY_Up @history_pos -=1 if @history_pos > 0 set_history_cmd fin = true elsif event.code == KEY_Down @history_pos += 1 if @history_pos < Watobo::Plugin::WShell.history_length-1 set_history_cmd fin = true end fin end @cmd.setFocus() @cmd.setDefault() @cmd_btn = FXButton.new(cmd_frame, "run") @executions = Watobo::Plugin::WShell.executions @cmd_btn.connect(SEL_COMMAND){ run_cmd } update_timer{ unless @executions.empty? cmd, result = @executions.pop # @output.appendText(">> #{cmd}\n") @output.appendText("#{result}\n") @output.appendText("\n---\n") @output.makePositionVisible @output.length-1 @cmd.enabled = true @cmd.backColor = FXColor::White @cmd.text = '' @cmd.setFocus end } end |