Is it possible to re-use constant definitions declared in description.ext (by #define keyword) in ordinary (sqs/sqf) scripts?
I was thinking of declaring alot of IDC/IDD constants in the description.ext, and re-use those in the script.
My intention is to declare the idc's and idd's once in the description.ext, and then use those to manipulate the controls using scripts. This would let me declare the variables at one place only.
Description.ext;
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define DLG_IDD 100
#define DLG_IDC_BTN_CLOSE 101
#define DLG_IDC_LBL_PICKLIST 102
#define DLG_IDC_CMB_PICKLIST 103
class dlgMyDialog {
idd = DLG_IDD;
controls[]={lblPicklist, btnClose, cmbPicklist};
class lblPicklist {
idc = DLG_IDC_LBL_PICKLIST;
... etc...
};
class cmbPicklist {
idc = DLG_IDC_CMB_PICKLIST;
...etc...
};
};
[/QUOTE]
Some script manipulating the content;
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_lbOK = lbAdd[DLG_IDC_CMB_PICKLIST, "My choice"];
ctrlSetText[DLG_IDC_LBL_PICKLIST, "Select command:"];[/QUOTE]
PS! I know this doesn't work, but I was hoping that some sort of script function could extract the values..
If I could extract those values into my script, I wouldn't have to redeclare the same variables, AND make sure they match with the description.ext declarations. This way, if I where to add additional controls, I would just insert it in the description.ext file using another #define, and make sure it doesn't come in conflict with other IDC/IDD numbers.
I'm pretty new to dialogs, so I might have misunderstood the whole concept, in which case please have me excused..
ZNorQ
HOME 
Reply With Quote
