Class: Wx::RTC::CommandProcessor
- Defined in:
- lib/wx/doc/gen/rtc/rich_text_ctrl.rb
Overview
CommandProcessor is a class that maintains a history of Commands, with undo/redo functionality built-in.
Derive a new class from this if you want different behaviour.
Category: Document/View Framework
Instance Method Summary collapse
-
#can_redo ⇒ Boolean
(also: #can_redo?)
Returns true if the currently-active command can be redone, false otherwise.
-
#can_undo ⇒ Boolean
(also: #can_undo?)
Returns true if the currently-active command can be undone, false otherwise.
-
#clear_commands ⇒ void
Deletes all commands in the list and sets the current command pointer to NULL.
-
#get_edit_menu ⇒ Wx::Menu
(also: #edit_menu)
Returns the edit menu associated with the command processor.
-
#get_max_commands ⇒ Integer
(also: #max_commands)
Returns the maximum number of commands that the command processor stores.
-
#get_redo_accelerator ⇒ Wx::String
(also: #redo_accelerator)
Returns the string that will be appended to the Redo menu item.
-
#get_redo_menu_label ⇒ String
(also: #redo_menu_label)
Returns the string that will be shown for the redo menu item.
-
#get_undo_accelerator ⇒ Wx::String
(also: #undo_accelerator)
Returns the string that will be appended to the Undo menu item.
-
#get_undo_menu_label ⇒ String
(also: #undo_menu_label)
Returns the string that will be shown for the undo menu item.
-
#initialize ⇒ void
constructor
Initializes the command processor, setting the current command to the last in the list (if any), and updating the edit menu (if one has been specified).
-
#is_dirty ⇒ Boolean
(also: #dirty?)
Returns a boolean value that indicates if changes have been made since the last save operation.
-
#mark_as_saved ⇒ void
You must call this method whenever the project is saved if you plan to use #is_dirty.
-
#redo_ ⇒ Boolean
Executes (redoes) the current command (the command that has just been undone if any).
-
#set_edit_menu(menu) ⇒ void
(also: #edit_menu=)
Tells the command processor to update the Undo and Redo items on this menu as appropriate.
-
#set_menu_strings ⇒ void
Sets the menu labels according to the currently set menu and the current command state.
-
#set_redo_accelerator(accel) ⇒ void
(also: #redo_accelerator=)
Sets the string that will be appended to the Redo menu item.
-
#set_undo_accelerator(accel) ⇒ void
(also: #undo_accelerator=)
Sets the string that will be appended to the Undo menu item.
-
#undo ⇒ Boolean
Undoes the last command executed.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ void
Initializes the command processor, setting the current command to the last in the list (if any), and updating the edit menu (if one has been specified).
1995 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 1995 def initialize(maxCommands=-1) end |
Instance Method Details
#can_redo ⇒ Boolean Also known as: can_redo?
Returns true if the currently-active command can be redone, false otherwise.
2004 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2004 def can_redo; end |
#can_undo ⇒ Boolean Also known as: can_undo?
Returns true if the currently-active command can be undone, false otherwise.
1999 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 1999 def can_undo; end |
#clear_commands ⇒ void
This method returns an undefined value.
Deletes all commands in the list and sets the current command pointer to NULL.
2009 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2009 def clear_commands; end |
#get_edit_menu ⇒ Wx::Menu Also known as:
Returns the edit menu associated with the command processor.
2013 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2013 def ; end |
#get_max_commands ⇒ Integer Also known as: max_commands
Returns the maximum number of commands that the command processor stores.
2018 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2018 def get_max_commands; end |
#get_redo_accelerator ⇒ Wx::String Also known as: redo_accelerator
Returns the string that will be appended to the Redo menu item.
2023 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2023 def get_redo_accelerator; end |
#get_redo_menu_label ⇒ String Also known as:
Returns the string that will be shown for the redo menu item.
2028 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2028 def ; end |
#get_undo_accelerator ⇒ Wx::String Also known as: undo_accelerator
Returns the string that will be appended to the Undo menu item.
2033 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2033 def get_undo_accelerator; end |
#get_undo_menu_label ⇒ String Also known as:
Returns the string that will be shown for the undo menu item.
2038 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2038 def ; end |
#is_dirty ⇒ Boolean Also known as: dirty?
Returns a boolean value that indicates if changes have been made since the last save operation.
This only works if #mark_as_saved is called whenever the project is saved.
2049 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2049 def is_dirty; end |
#mark_as_saved ⇒ void
This method returns an undefined value.
You must call this method whenever the project is saved if you plan to use #is_dirty.
2054 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2054 def mark_as_saved; end |
#redo_ ⇒ Boolean
Executes (redoes) the current command (the command that has just been undone if any).
2058 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2058 def redo_; end |
#set_edit_menu(menu) ⇒ void Also known as:
This method returns an undefined value.
Tells the command processor to update the Undo and Redo items on this menu as appropriate.
Set this to NULL if the menu is about to be destroyed and command operations may still be performed, or the command processor may try to access an invalid pointer.
2065 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2065 def () end |
#set_menu_strings ⇒ void
This method returns an undefined value.
Sets the menu labels according to the currently set menu and the current command state.
2070 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2070 def ; end |
#set_redo_accelerator(accel) ⇒ void Also known as: redo_accelerator=
This method returns an undefined value.
Sets the string that will be appended to the Redo menu item.
2075 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2075 def set_redo_accelerator(accel) end |
#set_undo_accelerator(accel) ⇒ void Also known as: undo_accelerator=
This method returns an undefined value.
Sets the string that will be appended to the Undo menu item.
2081 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2081 def set_undo_accelerator(accel) end |
#undo ⇒ Boolean
Undoes the last command executed.
2086 |
# File 'lib/wx/doc/gen/rtc/rich_text_ctrl.rb', line 2086 def undo; end |