THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/02/2005 at 10:33, xxxxxxxx wrote:
I may be out of my area here, but I don't think that's possible. Now you know why I create my dialogs programmatically within CreateLayout() and do not use dialog resources. ;0)
Here's the code of my quick scrollgroup with buttons. Maybe it will help you, maybe not. Note that LayoutLVGroup() should be called whenever you want to update the list display.
////////////////////////////////////////////////////////////////
// lvdialog.coh
////////////////////////////////////////////////////////////////
enum
{
ID_START = 4000,
ID_LVSGROUP,
ID_LVGROUP,
ID_LVITEMBASE = 5000
}
// CLASS: List View Dialog
class LVDialog : GeDialog
{
private:
var a;
public:
LVDialog();
CreateLayout();
LayoutLVGroup();
CreateLVGroup();
Init();
Message(msg);
Command(id, msg);
Initialize();
}
// Constructor
LVDialog::LVDialog()
{
super(PLUGIN_MENU_ID);
a = new(array,10);
a[0] = "Item 1";
a[1] = "Item 2";
a[2] = "Item 3";
a[3] = "Item 4";
a[4] = "Item 5";
a[5] = "Item 6";
a[6] = "Item 7";
a[7] = "Item 8";
a[8] = "Item 9";
a[9] = "Item 10";
}
// Layout Dialog GUI
LVDialog::CreateLayout()
{
SetTitle(resource->GetString(PLUGIN_MENU_TEXT)+" v"+resource->GetString(PLUGIN_MENU_VERSION));
AddGroupBeginV(4000,BFH_SCALEFIT|BFV_SCALEFIT,1,"",0);
{
AddGroupBorderSpace(4,4,4,4);
AddGroupSpace(4,4);
AddScrollGroupBegin(ID_LVSGROUP, BFH_CENTER|BFV_SCALEFIT, SCROLLGROUP_VERT|SCROLLGROUP_HORIZ|SCROLLGROUP_AUTOVERT|SCROLLGROUP_AUTOHORIZ);
{
AddGroupBorder(BORDER_IN);
AddGroupBeginV(ID_LVGROUP,BFH_SCALEFIT|BFV_SCALEFIT,1,"",0);
{
CreateLVGroup();
}
AddGroupEnd();
}
AddScrollGroupEnd();
}
AddGroupEnd();
return TRUE;
}
// Relayout LV Group
LVDialog::LayoutLVGroup()
{
LayoutFlushGroup(ID_LVGROUP);
CreateLVGroup();
LayoutChanged(ID_LVGROUP);
}
// Create ListView Group of Buttons
LVDialog::CreateLVGroup()
{
var x;
for (x = 0; x < 10; x++)
{
AddButton(ID_LVITEMBASE+i,BFH_LEFT|BFV_CENTER,0,0,a[x]);
}
}
LVDialog::Init()
{
}
LVDialog::Message(msg)
{
return super::Message(msg);
}
LVDialog::Command(id, msg)
{
if (id >= ID_LVITEMBASE)
{
println("Selected: ",id);
}
}