File: channel_check_listctrl.h

package info (click to toggle)
plucker 1.8-34
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 21,340 kB
  • sloc: ansic: 47,691; cpp: 42,310; python: 17,043; makefile: 1,521; perl: 1,492; pascal: 1,123; sh: 474; sed: 64; java: 13; csh: 6
file content (152 lines) | stat: -rw-r--r-- 5,789 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//----------------------------------------------------------------------------------------
/*!
    \file       channel_check_listctrl.h
    \modified                        
    \copyright  (c) Robert O'Connor ( rob@medicalmnemonics.com )    
    \licence    GPL
    \brief      Describes channel_check_listctrl class
    \author     Robert O'Connor
    \date       2001/10/29
 */  
// RCS-ID:      $Id: channel_check_listctrl.h,v 1.1 2003/03/17 17:43:19 robertoconnor Exp $
//----------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------
// Begin single inclusion of this .h file condition
//----------------------------------------------------------------------------------------

#ifndef _CHANNEL_CHECK_LISTCTRL_H_
#define _CHANNEL_CHECK_LISTCTRL_H_

//----------------------------------------------------------------------------------------
// GCC interface
//----------------------------------------------------------------------------------------

#if defined(__GNUG__) && ! defined(__APPLE__)
    #pragma interface "channel_check_listctrl.h"
#endif

//----------------------------------------------------------------------------------------
// Shared defines
//----------------------------------------------------------------------------------------

#include "plucker_defines.h"

//----------------------------------------------------------------------------------------
// Begin feature removal condition
//----------------------------------------------------------------------------------------

#if ( setupUSE_WIZARDS )

//----------------------------------------------------------------------------------------
// Headers
//----------------------------------------------------------------------------------------

#include "wx/listctrl.h"

//----------------------------------------------------------------------------------------

#include "channel_listctrl_base.h"

//----------------------------------------------------------------------------------------
// Class definition: channel_check_listctrl
//----------------------------------------------------------------------------------------

//! Listctrl of channels that can be selected or deselected.
/*!
    Uses the icons of the listctrl to toggle between checked and unchecked checkboxes.
 */
class channel_check_listctrl : public channel_listctrl_base
{

    DECLARE_DYNAMIC_CLASS( channel_check_listctrl )

public:

    //! Constructor.
        /*!
        \param parent The parent window.
        \param id The id of the progress_listbox. Will usually be -1 unless multiple
            of them on the same dialog.
        \param from_configuration The wxFileConfig to read the channels from.
        \param image_list_index The index of icon in the image_list to use for 
            newly inserted rows.
        \param options Class option flags.
        \param pos The pixel position of the listctrl on its parent window
        \param size The pixel size of the listctrl
        \param style Style of the listbox. See wxWindows wxListBox docs for details.
        \param validator Window validator. See wxWindows docs for details.
        \param name Windows name (rarely used).
     */
    channel_check_listctrl( wxWindow *parent,
                   wxWindowID id = -1,
                   wxFileConfig* from_configuration = the_configuration,
                   int default_image_list_index = plkrSMALL_IMAGE_LIST_ID_CHECKBOX_CHECKED,
                   long options = 0,
                   const wxPoint &pos = wxDefaultPosition,
                   const wxSize &size = wxDefaultSize,
                   long style = wxLC_REPORT,
                   const wxValidator& validator = wxDefaultValidator,
                   const wxString &name = "the_channel_check_listctrl" );

    // Unused constructor: solely for usage of RTTI (DYNAMIC_CLASS) macros.
    channel_check_listctrl() {};

    //! Destructor.
    ~channel_check_listctrl();

    //! Gets a wxArrayString of channel sections that are checked in the list.
    /*!
        \param channel_sections Pointer to array to store the channel sections.
        \note Different from get_selected_channel_sections function
            which is the ones that are cursor highlighted.
     */
    void get_checked_channel_sections( wxArrayString* channel_sections );

protected:

    //! Popup a context sensitive menu.
    virtual void    popup_menu( wxMouseEvent& event );

    //! Inserts the columns for the listctrl.
    virtual void    insert_columns();

    //! Sets the column widths. Called during init() an OnSize() .
    virtual void    set_column_widths();

private:

    //! Ask whether row is checked
    /*!
        \param row Row to examine
        \return TRUE if row is checked.
     */
    bool is_row_checked( long row ) const;

    //! Set whether row is checked
     /*!
        \param row Row to set checked or unchecked.
        \return TRUE to check row, FALSE to uncheck row.
     */
    void set_row_checked( long row,
                          bool checked
                         );

    //! Fires during a mouse event
    void on_mouse_event( wxMouseEvent& event );

    DECLARE_EVENT_TABLE()

};

//----------------------------------------------------------------------------------------
// End feature removal condition
//----------------------------------------------------------------------------------------

#endif  // setupUSE_WIZARDS

//----------------------------------------------------------------------------------------
// End single inclusion of this .h file condition
//----------------------------------------------------------------------------------------

#endif  // _CHANNEL_CHECK_LISTCTRL_H_