Link to home
Start Free TrialLog in
Avatar of pobwest
pobwest

asked on

More dialogs

what running dialogs boxes in TPW 1.5 i need to know how to put in values to edit boxes as soom as they are run.
Avatar of joe_h
joe_h

do you mean the default values that appear in an edit box as soon as the dialog appears?

Avatar of pobwest

ASKER

no, i can put in default values using the workshop, i need to know how to pass variables into them when they are executed.



 
If you are programming with object pascal then you have a PEdit object and you can call the setText method.
   If you are programming with raw windows (à la Petzold as I say) then we are going to write SendDlgItemMessage(hDlg,IDD_ITEM,EM_SETTEXT,0,Long(PChar(@Text))); or something similar!
Avatar of pobwest

ASKER

not quite what i meant.

When i run a dialog with:
 Application^.ExecDialog(New(PMyDialog, Init(@Self, DIALOG_2')));    

I want value to appear staight away, ie loaded from suitable variables.

I know how to send the data there:
 
setdlgitemint(Hwindow,250,Share_Pointer,false);

for example; but i need this to be run as soon as the dialog box is initiated.
   
You have a type TMyDialog and PMyDialog = ^TMyDialog. The object TMyDialog is probably extended from TDialog. The method SetupWindow is called on WM_INITDIALOG and at this point the "handle to window" TMyDialog.hWindow is valid and you can call setdlgitemint if you want.
Avatar of pobwest

ASKER

I'm still a bit lost with this dialog thing malarky.
Could you write down how you would run a dialog designed in resource work shop and enter values in it to see if I'm on the right lines?
Avatar of pobwest

ASKER

ha, stumped you all hey?
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial