Class: Wx::GRID::GridTableMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/grid/grid_table_message.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

Message class used by the grid table to send requests and notifications to the grid view.

A message object of this class must be sent to the grid using Wx::GRID::Grid#process_table_message every time the table changes, e.g. rows are added/deleted. The messages are just notifications and don't result in any changes to the table data, but allow the view to react to changes to the model. The table must be updated before sending the notification. For example, a custom Wx::GRID::GridTableBase#insert_rows implementation should first insert the rows into its own data storage and only then notify the grid:

  bool MyTable::InsertRows(size_t pos, size_t numRows)
  {
      DoInsertRowsInDataModel(pos, numRows);
  
      if ( GetView() )
      {
          GetView()->ProcessTableMessage(
              this, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, pos, numRows);
      }
  
      return true;
  }

The same rule applies to the other row and column modification messages: update the table first, then notify the grid.

Requires:

  • USE_GRID

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Wx::GRID::GridTableMessage #initialize(table, id, comInt1 = -1, comInt2 = -1) ⇒ Wx::GRID::GridTableMessage

Returns a new instance of GridTableMessage.

Overloads:

  • #initialize ⇒ Wx::GRID::GridTableMessage

    Default constructor initializes the object to invalid state.

  • #initialize(table, id, comInt1 = -1, comInt2 = -1) ⇒ Wx::GRID::GridTableMessage

    Constructor initializes the message.

    Parameters:

    • table (Wx::GRID::GridTableBase) —

      Pointer to the grid table

    • id (Integer) —

      One of Wx::GRID::GridTableRequest enum elements.

    • comInt1 (Integer) (defaults to: -1) —

      For the insert/delete messages, position at which the rows or columns are inserted/deleted. For the append messages, the number of rows or columns that were appended.

    • comInt2 (Integer) (defaults to: -1) —

      For the insert/delete messages, number of rows or columns to be inserted/deleted. For the append messages, this parameter is not used.



48
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 48

def initialize(*args) end

Instance Method Details

#get_command_int ⇒ Integer Also known as: command_int

Get the position at which the insertion/deletion occurs.

Returns:

  • (Integer)


80
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 80

def get_command_int; end

#get_command_int2 ⇒ Integer Also known as: command_int2

Get the number of rows to be inserted/deleted.

Returns:

  • (Integer)


91
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 91

def get_command_int2; end

#get_id ⇒ Integer Also known as: id

Gets an id.

Returns:

  • (Integer)


69
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 69

def get_id; end

#get_table_object ⇒ Wx::GRID::GridTableBase Also known as: table_object

Gets the table object.



58
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 58

def get_table_object; end

#set_command_int(comInt1) ⇒ void Also known as: command_int=

This method returns an undefined value.

Set the position at which the insertion/deletion occurs.

Parameters:

  • comInt1 (Integer)


75
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 75

def set_command_int(comInt1) end

#set_command_int2(comInt2) ⇒ void Also known as: command_int2=

This method returns an undefined value.

Set the number of rows to be inserted/deleted.

Parameters:

  • comInt2 (Integer)


86
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 86

def set_command_int2(comInt2) end

#set_id(id) ⇒ void Also known as: id=

This method returns an undefined value.

Sets an id.

Parameters:

  • id (Integer)


64
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 64

def set_id(id) end

#set_table_object(table) ⇒ void Also known as: table_object=

This method returns an undefined value.

Sets the table object.

Parameters:



53
# File 'lib/wx/doc/gen/grid/grid_table_message.rb', line 53

def set_table_object(table) end