in reply to Wx::Perl: How to change/set font and size of Wx::ListCtrl column headings?
The wxBook states, under the wxListItem class, "wxListItem is a class you can use to insert an item, set an item's properties, or retreive information from an item"..."Other functions set various additional visual properties: SetAlign, SetBackgroundColour, SetTextColour, and SetFont. These don't require a mask flag be specified. All wxListItem functions have equivalent accessors prefixed by Get for retrieving information about an item."..."An alternative to using wxListItem, you can use set and get properties for an item with wxListCtrl convenience functions such as SetItemText, SetItemImage...and so on"
That said in the example that followed, a wxListItem was created first that was then used to create the columns. So in print, at least, it seems that this is the way to format the column headings. Try adding colour/font calls to the example below after appropriate translation from C++ :).
// Insert three columns wxListItem itemCol; itemCol.SetText(wxT("Column 1")); itemCol.SetImage(-1); # itemCol.SetFont(....) etc listCtrlReport->InsertColumn(0, itemCol); listCtrlReport->SetColumnWidth(0, wxLIST_AUTOSIZE); itemCol.SetText(wxT("Column 2")); listCtrlReport->InsertColumn(1, itemCol); listCtrlReport->SetColumnWidth(1, wxLIST_AUTOSIZE); itemCol.SetText(wxT("Column 3")); listCtrlReport->InsertColumn(2, itemCol); listCtrlReport->SetColumnWidth(2, wxLIST_AUTOSIZE);
James
There's never enough time to do it right, but always enough time to do it over...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Wx::Perl: How to change/set font and size of Wx::ListCtrl column headings?
by Anonymous Monk on Mar 26, 2013 at 16:34 UTC | |
by jmlynesjr (Deacon) on Mar 26, 2013 at 17:02 UTC | |
|
Re^2: Wx::Perl: How to change/set font and size of Wx::ListCtrl column headings?
by HelenCr (Monk) on Mar 26, 2013 at 17:54 UTC | |
by jmlynesjr (Deacon) on Mar 27, 2013 at 01:09 UTC | |
by HelenCr (Monk) on Mar 27, 2013 at 07:27 UTC | |
by jmlynesjr (Deacon) on Mar 27, 2013 at 15:26 UTC | |
by Anonymous Monk on Mar 27, 2013 at 07:49 UTC |