Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

main_listctrl Class Reference

Listctrl used in the main_frame . More...

#include <main_listctrl.h>

Inheritance diagram for main_listctrl:

wxListCtrl List of all members.

Public Methods

  main_listctrl (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_REPORT, const wxValidator &validator=wxDefaultValidator, const wxString &name="the_main_listctrl")
  Constructor.

  main_listctrl ()
  ~main_listctrl ()
  Destructor.

void  init ()
  Initialize the listctrl.

void  gui_add_channel ()
  Add a channel in the GUI manner.

void  gui_add_channel_wizard ()
  Add a channel using an add_channel_wizard object.

void  gui_configure_channel ()
  Handle lauching of a channel_dialog to configure channel currently selected channel..

void  gui_delete_channels (bool prompt_first=TRUE)
  Delete the channels selected in the listctrl, in the GUI manner.

void  gui_update_selected_channels ()
  Update the selected channels in a GUI way.

void  gui_update_due_channels ()
  Update all due channels in a GUI way.

void  gui_update_all_channels ()
  Update all channels in a GUI way.

void  paste_text_url_as_new_channel (const wxString &url)
  Paste text from clipboard as a new channel.

void  paste_fullnames_as_new_separate_channels (const wxArrayString &fullnames)
  Paste files from clipboard as separate new channels.

void  on_paste_url_as_new_channel_menuitem ()
  Action to execute when user chose 'Paste url...' from a menu.

void  on_paste_fullnames_as_new_separate_channels_menuitem ()
  Action to execute when user chose 'Paste filenames...' from a menu.


Protected Methods

void  load_rows ()
  Loads the rows of the listctrl with channel names and due dates.

void  insert_row (wxString &channel_section)
  Inserts an individual row into the listctrl.

void  refresh_row (long row_number)
  Refreshes a row, updating a row's channel name and due date if they have changed.

void  refresh_rows (wxArrayString &channel_sections)
  Refreshes rows, updating rows' channel name and due date if they have changed.

void  get_selected_channel_sections (wxArrayString *channel_sections)
  Get the section of configuration file of channels selected in the listctrl.

void  get_selected_row_numbers (wxArrayInt *row_numbers)
  Get the row numbers that are selected in the listctrl (with top row=0).

wxString  get_cell_contents_string (long row_number, int column)
  Gets the string contents of a 'cell' [a box of a certain row, in a certain column].

wxString  get_row_channel_section (long row_number)
  Get the wxString of a channel's section in the config, based on its row number.

void  set_row_channel_section (const wxString &channel_section, long row_number)
  Set a channel's section in the configuration, by its row number.

void  insert_row_channel_section (const wxString &channel_section, long row_number)
  Insert a channel section in the array, before the specified index.

void  remove_row_channel_section (long row_number)
  Deletes a channel section in the array, at the specified index.

bool  ensure_destinations_provided (const wxArrayString &channel_sections)
  A GUI check to ensure that a channel about to be updated has a destination.

void  popup_menu (wxMouseEvent &event)
  Popup a context sensitive menu.

void  launch_dialog_for_new_channel (const wxString &new_channel_section)
  Launch a channel_dialog for a newly created channel.

wxString  get_channel_name_from_text_entry_dialog ()
  Gets a channel name from a popup text entrry dialog.

void  OnSize (wxSizeEvent &event)
  Overriden virtual: action to execute in response to a resize event.

void  set_column_widths ()
  Sets the column widths. Called during init() an OnSize() .


Protected Attributes

wxWindow *  m_parent
  Parent window of the listctrl.

wxArrayString  m_row_channel_section_array
  An array of section names of the individual rows of the listctrl.


Detailed Description

Listctrl used in the main_frame .

Currently the hub of the gui management of the non_visual plucker_controller object. The main_frame parent just calls this listctrl's methods in response to main toolbar and main menubar events.

It works via keeping a non-visible array of strings of the channel sections in m_row_channel_section_array that is kept in sync with the order of the channels in the listctrl.


Constructor & Destructor Documentation

main_listctrl::main_listctrl wxWindow *    parent,
wxWindowID    id = -1,
const wxPoint &    pos = wxDefaultPosition,
const wxSize &    size = wxDefaultSize,
long    style = wxLC_REPORT,
const wxValidator &    validator = wxDefaultValidator,
const wxString &    name = "the_main_listctrl"
 

Constructor.

Parameters:
parent  The parent window.
id  The id of the progress_listbox. Will usually be -1 unless multiple of them on the same dialog.
pos  The pixel position of the listctrl on its parent window
size  The pixel size of the listctrl
style  Style of the listbox. See wxWindows wxListBox docs for details.
validator  Window validator. See wxWindows docs for details.
name  Windows name (rarely used).

Member Function Documentation

bool main_listctrl::ensure_destinations_provided const wxArrayString &    channel_sections [protected]
 

A GUI check to ensure that a channel about to be updated has a destination.

Checks to see that some destinations have been chosen for the selected channels If not, pops up a channel_dialog for that channel, with the destination tab selected.

Parameters:
channel_sections  Array of configuration file channel sections to ensure have each have a destination.
Returns :
Whether one was needed
wxString main_listctrl::get_cell_contents_string long    row_number,
int    column
[protected]
 

Gets the string contents of a 'cell' [a box of a certain row, in a certain column].

Parameters:
row_number  The row number of the cell [0=top row].
column  The column number of the cell [0=left row].
Returns :
The content string of the cell
wxString main_listctrl::get_channel_name_from_text_entry_dialog   [protected]
 

Gets a channel name from a popup text entrry dialog.

Returns :
The channel name that user entered.
wxString main_listctrl::get_row_channel_section long    row_number [protected]
 

Get the wxString of a channel's section in the config, based on its row number.

Parameters:
row_number  The row number of listctrl to query for a channel_section to add to the array.
Returns :
A channel section name.
void main_listctrl::get_selected_channel_sections wxArrayString *    channel_sections [protected]
 

Get the section of configuration file of channels selected in the listctrl.

Parameters:
channel_sections  Array to hold the channel sections.
void main_listctrl::get_selected_row_numbers wxArrayInt *    row_numbers [protected]
 

Get the row numbers that are selected in the listctrl (with top row=0).

Parameters:
channel_sections  Array to hold the channel sections.
void main_listctrl::gui_configure_channel  
 

Handle lauching of a channel_dialog to configure channel currently selected channel..

Note: also used on the list control double-click event.

void main_listctrl::gui_delete_channels bool    prompt_first = TRUE
 

Delete the channels selected in the listctrl, in the GUI manner.

Parameters:
prompt_first  TRUE if should show a confirm message dialog before deleting.
void main_listctrl::insert_row wxString &    channel_section [protected]
 

Inserts an individual row into the listctrl.

Parameters:
channel_section  Channel section in configuration file, holding the row's channel data to be inserted.
void main_listctrl::insert_row_channel_section const wxString &    channel_section,
long    row_number
[protected]
 

Insert a channel section in the array, before the specified index.

Parameters:
channel_section  The configruation file's channel section to insert.
row_number  The row number of the channel_section to delete from array.
void main_listctrl::launch_dialog_for_new_channel const wxString &    new_channel_section [protected]
 

Launch a channel_dialog for a newly created channel.

Warning:
Only use this for newly created channels.
void main_listctrl::on_paste_fullnames_as_new_separate_channels_menuitem  
 

Action to execute when user chose 'Paste filenames...' from a menu.

Public, so can be used both by the main_frame menuitems, and the popup menu item on the main_listctrl.

void main_listctrl::on_paste_url_as_new_channel_menuitem  
 

Action to execute when user chose 'Paste url...' from a menu.

Public, so can be used both by the main_frame menuitems, and the popup menu item on the main_listctrl.

void main_listctrl::paste_text_url_as_new_channel const wxString &    url
 

Paste text from clipboard as a new channel.

Public, so it can be used by the drop targets.

void main_listctrl::refresh_row long    row_number [protected]
 

Refreshes a row, updating a row's channel name and due date if they have changed.

Parameters:
row_number  The row number of the listctrl to refresh (0 is top row).
void main_listctrl::refresh_rows wxArrayString &    channel_sections [protected]
 

Refreshes rows, updating rows' channel name and due date if they have changed.

Parameters:
channel_sections  The configuration file's sections of the channels to be refreshed.
void main_listctrl::remove_row_channel_section long    row_number [protected]
 

Deletes a channel section in the array, at the specified index.

Parameters:
row_number  The row number of the channel_section to delete from array.
void main_listctrl::set_row_channel_section const wxString &    channel_section,
long    row_number
[protected]
 

Set a channel's section in the configuration, by its row number.

Parameters:
channel_section  The configruation file's channel section to insert.
row_number  The row number of the channel_section to delete from array.