|
9 | 9 | static Constant popupLength = 240
|
10 | 10 | static Constant moduleCtrlTop = 10
|
11 | 11 | static Constant procCtrlTop = 40
|
| 12 | +static Constant SortCtrlTop = 70 |
12 | 13 | static Constant border = 5
|
13 |
| -static Constant topSpaceList = 80 |
| 14 | +static Constant topSpaceList = 90 |
14 | 15 |
|
15 | 16 | static StrConstant panel = "CodeBrowser"
|
16 | 17 | static StrConstant moduleCtrl = "popupNamespace"
|
17 | 18 | static StrConstant procCtrl = "popupProcedure"
|
18 | 19 | static StrConstant listCtrl = "list1"
|
| 20 | +static StrConstant sortCtrl = "checkboxSort" |
19 | 21 | static StrConstant userDataRawList = "rawList"
|
20 | 22 | static StrConstant userDataNiceList = "niceList"
|
21 | 23 |
|
@@ -59,6 +61,9 @@ Function createPanel()
|
59 | 61 | ListBox $listCtrl, win=$panel,mode=5,selCol=1, widths={4,40}, keySelectCol=1
|
60 | 62 | ListBox $listCtrl, win=$panel,listWave=getDeclWave()
|
61 | 63 |
|
| 64 | + CheckBox $sortCtrl, win=$panel, pos={30,SortCtrlTop},size={40,20},value=prefs.panelCheckboxSort |
| 65 | + CheckBox $sortCtrl, win=$panel, title="sort" |
| 66 | + CheckBox $sortCtrl, win=$panel, proc=$(module + "#checkboxSort") |
62 | 67 | SetWindow $panel, hook(mainHook)=$(module + "#panelHook")
|
63 | 68 | DoUpdate/W=$panel
|
64 | 69 |
|
@@ -118,6 +123,7 @@ Function resizePanel()
|
118 | 123 | left = (width - V_Width) / 2.0
|
119 | 124 | PopupMenu $moduleCtrl, win=$panel,pos={left,moduleCtrlTop}
|
120 | 125 | PopupMenu $procCtrl, win=$panel,pos={left+8,procCtrlTop}
|
| 126 | + CheckBox $sortCtrl, win=$panel,pos={left+66,SortCtrlTop} |
121 | 127 | End
|
122 | 128 |
|
123 | 129 | // Must be called after every change which might affect the panel contents
|
@@ -305,6 +311,32 @@ Function popupProcedures(pa) : PopupMenuControl
|
305 | 311 | return 0
|
306 | 312 | End
|
307 | 313 |
|
| 314 | +Function checkboxSort(cba) : CheckBoxControl |
| 315 | + STRUCT WMCheckboxAction &cba |
| 316 | + |
| 317 | + switch( cba.eventCode ) |
| 318 | + case 2: // mouse up |
| 319 | + updateListBoxHook() |
| 320 | + break |
| 321 | + case -1: // control being killed |
| 322 | + break |
| 323 | + endswitch |
| 324 | + |
| 325 | + return 0 |
| 326 | +End |
| 327 | + |
| 328 | +// returns 0 if checkbox is deselected or 1 if it is selected. |
| 329 | +Function returnCheckBoxSort() |
| 330 | + ControlInfo/W=$panel $sortCtrl |
| 331 | + if (V_flag == 2) // Checkbox found? |
| 332 | + return V_Value |
| 333 | + else |
| 334 | + //Fallback: Sorting as default behaviour |
| 335 | + return 1 |
| 336 | + endif |
| 337 | +End |
| 338 | + |
| 339 | + |
308 | 340 | Function listBoxProc(lba) : ListBoxControl
|
309 | 341 | STRUCT WMListboxAction &lba
|
310 | 342 |
|
|
0 commit comments