]> git.saurik.com Git - wxWidgets.git/blame - samples/xrc/custclas.h
XRC spec: document wxRibbon* XRC handler.
[wxWidgets.git] / samples / xrc / custclas.h
CommitLineData
af1337b0
JS
1//-----------------------------------------------------------------------------
2// Name: custclas.h
3// Purpose: XML resources sample: A custom class to insert into a XRC file
4// Author: Robert O'Connor (rob@medicalmnemonics.com), Vaclav Slavik
af1337b0
JS
5// Copyright: (c) Robert O'Connor and Vaclav Slavik
6// Licence: wxWindows licence
7//-----------------------------------------------------------------------------
8
9//----------------------------------------------------------------------------------------
10// Begin single inclusion of this .h file condition
11//----------------------------------------------------------------------------------------
12
13#ifndef _CUSTCLAS_H_
14#define _CUSTCLAS_H_
15
16//----------------------------------------------------------------------------------------
af1337b0
JS
17// Headers
18//----------------------------------------------------------------------------------------
19
20#include "wx/listctrl.h"
21
22//----------------------------------------------------------------------------------------
23// Class definition: MyResizableListCtrl
24//----------------------------------------------------------------------------------------
25
26//! A custom listctrl that resizes itself and pops up a context-sensitive menu.
27class MyResizableListCtrl : public wxListCtrl
28{
be5a51fb 29 // Very helpful wxWidgets macro required for wxWidgets-RTTI tracing: By using this
d13b34d3 30 // you will see "Leaked one object of type myResizableListCtrl" in the debug log,
af1337b0 31 // along with which line you if was created, but you forget to free the memory.
f80ea77b 32 // NOTE: Using this REQUIRES a default constructor: that means either: giving a
af1337b0
JS
33 // default value for all parameters in your constructor, or else having a dummy
34 // MyResizableListCtrl(){} constructor in addition to your regular one.
35 DECLARE_DYNAMIC_CLASS( MyResizableListCtrl )
36
37public:
38
f80ea77b 39 // Constructor.
af1337b0 40 /*
be5a51fb 41 These parameters are the same as a wxWidgets constructor.
af1337b0
JS
42 \param parent The parent window.
43 \param id The id of the progress_listbox. Will usually be -1 unless multiple
44 of them on the same dialog.
45 \param pos The pixel position of the listctrl on its parent window
46 \param size The pixel size of the listctrl
be5a51fb
JS
47 \param style Style of the listbox. See wxWidgets wxListBox docs for details.
48 \param validator Window validator. See wxWidgets docs for details.
af1337b0
JS
49 \param name Windows name (rarely used).
50 \param exclusion_column_caption The label of header of listctrl's exclusion
51 column.
52 */
53 MyResizableListCtrl( wxWindow *parent = NULL,
f80ea77b 54 wxWindowID id = wxID_ANY,
af1337b0
JS
55 const wxPoint &pos = wxDefaultPosition,
56 const wxSize &size = wxDefaultSize,
57 long style = wxLC_REPORT,
58 const wxValidator& validator = wxDefaultValidator,
59 const wxString &name = wxT("myResizableListCtrl")
f80ea77b 60 );
af1337b0 61
d13b34d3 62 // Destructor.
925e9792 63 ~MyResizableListCtrl(){};
af1337b0 64
f80ea77b
WS
65protected:
66
67 // A custom function for a context sensitive menu.
68 void ContextSensitiveMenu( wxMouseEvent& event );
af1337b0 69
be5a51fb 70 // This is a wxWidgets function that we are going to override with our own behaviour.
af1337b0 71 void OnSize( wxSizeEvent &event );
f80ea77b 72
af1337b0 73 // A custom function. What is called in the constructor, and in an OnSize()
f80ea77b
WS
74 void SetColumnWidths();
75
af1337b0
JS
76private:
77
be5a51fb 78 // wxWidgets macro, required to be able to use Event tables in the .cpp file.
af1337b0 79 DECLARE_EVENT_TABLE()
f80ea77b 80
af1337b0
JS
81};
82
83//----------------------------------------------------------------------------------------
84// End single inclusion of this .h file condition
85//----------------------------------------------------------------------------------------
86
87#endif //_CUSTCLAS_H_
88