Need some advice (array pointer in structure)
Posted: Thu Mar 18, 2010 1:31 pm
Hi, im making a ComboBox plugin for another application and i want to add some advanced options but iv hit a bit of a wall
i using a ownerdrawn api combo, iv added icons, text and back color for default and selection, now i want to add alternate icons and item colors for each item, but im struggling to figure out how to store the information
for the basic operation of the icons i have used the item data and for the colors i have attached props to the combos parent container, this all works fine
now i want to add colors and a alternate icon for the selection of each individual item, i have the basic setup in place but i see a huge memory problem
i am using the below structure, but i need the arrays to be dynamic, a combo with only a handful of items is going to use far to much memory (i dont know to much about this, correct me if i am wrong) and if 5/6 combos are added with only a few items in each, the memory over usage is some thing i just cant live with
i have searched the forum, and found some complex solutions i could probably edit to suit my needs, but before i do, i would like some input from the PB gurus that could maybe point me to a simple solution
any advice or tips would be greatly appreciated, and thanks for your time
i using a ownerdrawn api combo, iv added icons, text and back color for default and selection, now i want to add alternate icons and item colors for each item, but im struggling to figure out how to store the information
for the basic operation of the icons i have used the item data and for the colors i have attached props to the combos parent container, this all works fine
now i want to add colors and a alternate icon for the selection of each individual item, i have the basic setup in place but i see a huge memory problem
i am using the below structure, but i need the arrays to be dynamic, a combo with only a handful of items is going to use far to much memory (i dont know to much about this, correct me if i am wrong) and if 5/6 combos are added with only a few items in each, the memory over usage is some thing i just cant live with
Code: Select all
Structure COMBOINFO
; base info
GadgetID.l
X.l
Y.l
Width.l
Height.l
; item text
ItemDefText.s[100]
ItemSelText.s[100]
; item icons
ItemDefIcon.l[100]
ItemSelIcon.l[100]
; item text color
ItemDefTextColor.l[100]
ItemSelTextColor.l[100]
; item back color
ItemDefBackColor.l[100]
ItemSelBackColor.l[100]
EndStructure
Global NewList Combo.COMBOIMNFO()any advice or tips would be greatly appreciated, and thanks for your time