Skip to content
This repository
Browse code

Add support for virtual ListCtrl, and a few other unwrapped ListCtrl …

…methods.

Added methods: listCtrlGetItemFont, listCtrlIsVirtual, listCtrlRefreshItem, listCtrlRefreshItems.
Added constants: wxLC_VIRTUAL, wxLC_MASK_TYPE, wxLC_MASK_ALIGN, wxLC_MASK_SORT.
Removed deprecated constant wxLC_USER_TEXT.
  • Loading branch information...
commit b5d1029b272460d729950d751d90da76df56b5dc 1 parent f225d0c
Jeremy O'Donoghue authored April 22, 2012
25  wxc/src/cpp/eljlistctrl.cpp
@@ -25,6 +25,7 @@ EWXWEXPORT(void,wxListItem_Delete)(wxListItem* self)
25 25
 {
26 26
 	delete self;
27 27
 }
  28
+
28 29
 EWXWEXPORT(void,wxListItem_Clear)(wxListItem* self)
29 30
 {
30 31
 	self->Clear();
@@ -483,5 +484,27 @@ EWXWEXPORT(void,wxListCtrl_UpdateStyle)(wxListCtrl* self)
483 484
 	self->UpdateStyle();
484 485
 #endif
485 486
 }
486  
-	
  487
+
  488
+EWXWEXPORT(wxFont*,wxListCtrl_GetItemFont)(wxListCtrl* self, long item)
  489
+{
  490
+  wxFont* fnt = new wxFont;
  491
+  *fnt = self->GetItemFont(item);
  492
+  return fnt;
  493
+}
  494
+
  495
+EWXWEXPORT(bool,wxListCtrl_IsVirtual)(wxListCtrl* self)
  496
+{
  497
+  return self->IsVirtual();
  498
+}
  499
+
  500
+EWXWEXPORT(void,wxListCtrl_RefreshItem)(wxListCtrl* self, long item)
  501
+{
  502
+  self->RefreshItem(item);
  503
+}
  504
+
  505
+EWXWEXPORT(void,wxListCtrl_RefreshItems)(wxListCtrl* self, long from, long to)
  506
+{
  507
+  self->RefreshItems(from, to);
  508
+}
  509
+
487 510
 }
3  wxc/src/include/wxc_glue.h
@@ -3067,6 +3067,7 @@ TClass(wxImageList) wxListCtrl_GetImageList( TSelf(wxListCtrl) _obj, int which )
3067 3067
 TBool      wxListCtrl_GetItem( TSelf(wxListCtrl) _obj, TClass(wxListItem) info );
3068 3068
 int        wxListCtrl_GetItemCount( TSelf(wxListCtrl) _obj );
3069 3069
 int        wxListCtrl_GetItemData( TSelf(wxListCtrl) _obj, int item );
  3070
+TClass(wxFont) wxListCtrl_GetItemFont( TSelf(wxListCtrl) _obj, long item);
3070 3071
 TClass(wxPoint) wxListCtrl_GetItemPosition( TSelf(wxListCtrl) _obj, int item );
3071 3072
 TClass(wxRect) wxListCtrl_GetItemRect( TSelf(wxListCtrl) _obj, int item, int code );
3072 3073
 TClass(wxSize) wxListCtrl_GetItemSpacing( TSelf(wxListCtrl) _obj, TBool isSmall );
@@ -3083,6 +3084,8 @@ int        wxListCtrl_InsertItem( TSelf(wxListCtrl) _obj, TClass(wxListItem) inf
3083 3084
 int        wxListCtrl_InsertItemWithData( TSelf(wxListCtrl) _obj, int index, TClass(wxString) label );
3084 3085
 int        wxListCtrl_InsertItemWithImage( TSelf(wxListCtrl) _obj, int index, int imageIndex );
3085 3086
 int        wxListCtrl_InsertItemWithLabel( TSelf(wxListCtrl) _obj, int index, TClass(wxString) label, int imageIndex );
  3087
+TBool      wxListCtrl_IsVirtual( TSelf(wxListCtrl) _obj );
  3088
+void       wxListCtrl_RefreshItem( TSelf(wxListCtrl) _obj, long item );
3086 3089
 TBool      wxListCtrl_ScrollList( TSelf(wxListCtrl) _obj, TVector(dx,dy) );
3087 3090
 void       wxListCtrl_SetBackgroundColour( TSelf(wxListCtrl) _obj, TClass(wxColour) col );
3088 3091
 TBool      wxListCtrl_SetColumn( TSelf(wxListCtrl) _obj, int col, TClass(wxListItem) item );
2  wxc/wxc.cabal
... ...
@@ -1,5 +1,5 @@
1 1
 name:         wxc
2  
-version:      0.90.0.3
  2
+version:      0.90.0.4
3 3
 license:      OtherLicense
4 4
 license-file: LICENSE
5 5
 maintainer:   wxhaskell-devel@lists.sourceforge.net
31  wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
@@ -91,8 +91,6 @@ module Graphics.UI.WXCore.WxcDefs
91 91
      ,wxSTREAM_WRITE_ERROR
92 92
      ,wxSTREAM_READ_ERROR
93 93
      ,wxNB_MULTILINE
94  
-     ,wxLC_VRULES
95  
-     ,wxLC_HRULES
96 94
      ,wxIMAGE_LIST_NORMAL
97 95
      ,wxIMAGE_LIST_SMALL
98 96
      ,wxIMAGE_LIST_STATE
@@ -337,6 +335,8 @@ module Graphics.UI.WXCore.WxcDefs
337 335
      ,wxBU_TOP
338 336
      ,wxBU_RIGHT
339 337
      ,wxBU_BOTTOM
  338
+     ,wxLC_VRULES
  339
+     ,wxLC_HRULES
340 340
      ,wxLC_ICON
341 341
      ,wxLC_SMALL_ICON
342 342
      ,wxLC_LIST
@@ -344,13 +344,16 @@ module Graphics.UI.WXCore.WxcDefs
344 344
      ,wxLC_ALIGN_TOP
345 345
      ,wxLC_ALIGN_LEFT
346 346
      ,wxLC_AUTOARRANGE
347  
-     ,wxLC_USER_TEXT
  347
+     ,wxLC_VIRTUAL
348 348
      ,wxLC_EDIT_LABELS
349 349
      ,wxLC_NO_HEADER
350 350
      ,wxLC_NO_SORT_HEADER
351 351
      ,wxLC_SINGLE_SEL
352 352
      ,wxLC_SORT_ASCENDING
353 353
      ,wxLC_SORT_DESCENDING
  354
+     ,wxLC_MASK_TYPE
  355
+     ,wxLC_MASK_ALIGN
  356
+     ,wxLC_MASK_SORT
354 357
      ,wxSP_ARROW_KEYS
355 358
      ,wxSP_WRAP
356 359
      ,wxSP_NOBORDER
@@ -2484,6 +2487,8 @@ module Graphics.UI.WXCore.WxcDefs
2484 2487
      ,wxSTC_CMD_WORDRIGHTENDEXTEND
2485 2488
     ) where
2486 2489
 
  2490
+import Data.Bits
  2491
+
2487 2492
 -- | A flag can be combined with other flags to a bit mask.
2488 2493
 type BitFlag = Int
2489 2494
 
@@ -2679,12 +2684,6 @@ wxSTREAM_READ_ERROR = 3
2679 2684
 wxNB_MULTILINE :: Int
2680 2685
 wxNB_MULTILINE = 256
2681 2686
 
2682  
-wxLC_VRULES :: Int
2683  
-wxLC_VRULES = 1
2684  
-
2685  
-wxLC_HRULES :: Int
2686  
-wxLC_HRULES = 2
2687  
-
2688 2687
 wxIMAGE_LIST_NORMAL :: Int
2689 2688
 wxIMAGE_LIST_NORMAL = 0
2690 2689
 
@@ -3417,6 +3416,12 @@ wxBU_RIGHT = 256
3417 3416
 wxBU_BOTTOM :: Int
3418 3417
 wxBU_BOTTOM = 512
3419 3418
 
  3419
+wxLC_VRULES :: Int
  3420
+wxLC_VRULES = 1
  3421
+
  3422
+wxLC_HRULES :: Int
  3423
+wxLC_HRULES = 2
  3424
+
3420 3425
 wxLC_ICON :: Int
3421 3426
 wxLC_ICON = 4
3422 3427
 
@@ -3438,8 +3443,8 @@ wxLC_ALIGN_LEFT = 128
3438 3443
 wxLC_AUTOARRANGE :: Int
3439 3444
 wxLC_AUTOARRANGE = 256
3440 3445
 
3441  
-wxLC_USER_TEXT :: Int
3442  
-wxLC_USER_TEXT = 512
  3446
+wxLC_VIRTUAL :: Int
  3447
+wxLC_VIRTUAL = 512
3443 3448
 
3444 3449
 wxLC_EDIT_LABELS :: Int
3445 3450
 wxLC_EDIT_LABELS = 1024
@@ -3459,6 +3464,10 @@ wxLC_SORT_ASCENDING = 16384
3459 3464
 wxLC_SORT_DESCENDING :: Int
3460 3465
 wxLC_SORT_DESCENDING = 32768
3461 3466
 
  3467
+wxLC_MASK_TYPE  = wxLC_ICON .|. wxLC_SMALL_ICON .|. wxLC_LIST .|. wxLC_REPORT
  3468
+wxLC_MASK_ALIGN = wxLC_ALIGN_TOP .|. wxLC_ALIGN_LEFT
  3469
+wxLC_MASK_SORT  = wxLC_SORT_ASCENDING .|. wxLC_SORT_DESCENDING
  3470
+
3462 3471
 wxSP_ARROW_KEYS :: Int
3463 3472
 wxSP_ARROW_KEYS = 4096
3464 3473
 
4  wxcore/wxcore.cabal
... ...
@@ -1,5 +1,5 @@
1 1
 name:         wxcore
2  
-version:      0.90.0.1
  2
+version:      0.90.0.2
3 3
 license:      OtherLicense
4 4
 license-file: LICENSE
5 5
 author:       Daan Leijen
@@ -71,7 +71,7 @@ library
71 71
     filepath,
72 72
     parsec,
73 73
     stm,
74  
-    wxc >= 0.90,
  74
+    wxc >= 0.90.0.4,
75 75
     wxdirect >= 0.90,
76 76
     directory,
77 77
     time

0 notes on commit b5d1029

Please sign in to comment.
Something went wrong with that request. Please try again.