...
During translation, the gmBasic engine calls the gmSL IListItems_Add method that examines the REF to IListItems.Add operation and modifies repalces replaces it with the selected pattern operation, PAT.Add_SmallIcon, instead of the REF.IListItem.Add method:
Code Block |
---|
Modified IL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\gmTestBed\FileExplorer\proj_csh\report\FileExplorer_csh-CustomSearch.tab ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4067 Detailed Description of Subprogram FileExplorer.frmExploreLite.AddListItem with root address 266343: ... 4082 Actual csh Codeblock Associated with AddListItem: 4083 Offset | Sl.Start | Ql.Start | Quantity type | Opcode | Operation support information 4084 ------ | -------- | -------- | ------------- | ------ | ----------------------------- 4085 0 | | | | REM | NULL 4086 5 | | | | REM | 57:Add a ListItem, then additional columns as ListSubItems. 4087 10 | | | | NEW | 656 Dim liListItem As ListItem 4088 13 | | | | DCL | Variable:liListItem:266701 4089 18 | | | | NEW | 657 Set liListItem = lvListView.ListItems.Add(, , itemText, "genericMedium", "genericSmall") 4090 21 | 1.21 | 1.21 | MSComctlLib.ListItem | LDA | Variable:liListItem:266701 4091 26 | 1.21 | 1.21 | MSComctlLib.ListItem | LEV | Nest0 4092 28 | 2.28 | 2.28 | MSComctlLib.ListView | LDA | MSComctlLib.ListView:lvListView:262825 4093 33 | 3.33 | 2.28 | MSComctlLib.ListItem | LLP | Component:ListItems:157565 4094 38 | 2.28 | 2.28 | MSComctlLib.ListItem | MEM | Child 4095 40 | 2.28 | 2.28 | MSComctlLib.ListItem | LEV | Nest1 4096 42 | 3.42 | 3.42 | Integer | DEF | MissingZero 4097 44 | 3.42 | 2.28 | MSComctlLib.ListItem | ARG | Integer 4098 46 | 3.42 | 2.28 | MSComctlLib.ListItem | LEV | Nest1 4099 48 | 4.48 | 3.48 | String | DEF | EmptyString 4100 50 | 4.48 | 2.28 | MSComctlLib.ListItem | ARG | String 4101 52 | 4.48 | 2.28 | MSComctlLib.ListItem | LEV | Nest1 4102 54 | 5.54 | 3.54 | String | LDA | Variable:itemText:266487 4103 59 | 5.54 | 2.28 | MSComctlLib.ListItem | ARG | String 4104 61 | 5.54 | 2.28 | MSComctlLib.ListItem | LEV | Nest1 4105 63 | 6.63 | 3.63 | String | LSC | 13:genericMedium 4106 68 | 6.63 | 2.28 | MSComctlLib.ListItem | ARG | String 4107 70 | 6.63 | 2.28 | MSComctlLib.ListItem | LEV | Nest1 4108 72 | 7.72 | 3.72 | String | LSC | 12:genericSmall 4109 77 | 7.72 | 2.28 | MSComctlLib.ListItem | ARG | String >4110 79 | 2.28 | 2.28 | MSComctlLib.ListItem | PAT | Component:Add_SmallIcon:182799 4111 84 | 2.28 | 2.28 | MSComctlLib.ListItem | REF | Component:Add:163224 4112 89 | 2.28 | 1.21 | MSComctlLib.ListItem | ARG | Object 4113 91 | | 2.91 | Void | CMD | Set 4114 93 | | | | REM | NULL 4115 98 | | | | NEW | 659 With liListItem.ListSubItems |
...
Code Block |
---|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \gmTestBed\FileExplorer\proj_csh\deploy\FileExplorer\frmExploreLite.cs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 378 private void AddListItem(string itemKey,string itemText,string itemSize,string itemType,DateTime itemModified) 379 { ... > 383 liListItem = lvListView.Items.Add(itemText,"genericSmall"); ... |
Notice that the final code for this sample ignores the Icon argument, as there can be only one image in .NET and this particular demo actually uses the SmallIcon when you run it.
If both icons were needed a different solution would be required and this might require an extended ListView that supports both large and small icons.
See also
FileExplorer sample