Hey there,
Just to extend on what Travis was saying, I thought I'd provide you with a sampler, just to help you out so you can know what to do
Cause DCX is a tad tricky especially when your new to it!
;// So you have your Dialog Table...
dialog mf_tb_table {
title ""
size -1 -1 625 37
}
on *:DIALOG:mf_tb:init:0:{
;// YOU NEED THIS!! It allows the Call back alias to work!
dcx Mark $dname cb_function
xdialog -c $dname 1 toolbar -3 -3 496 34 flat top list tooltips arrows tabstop
xdid -l $dname 1 32
xdid -m $dname 1 0
xdid -w $dname 1 +n 0 C:\Users\Liam\Kaleidoscope\sys\k.ico
xdid -a $dname 1 1 +cv 100 1 $rgb(255,0,0) Button $chr(9) Tooltip
;//Docks toolbar
.timertb_dock 1 0 xdock -m $dialog($dname).hwnd +t
}
alias cb_function {
if ($2 != mouse) echo -s $1-
}
Okay, so thats the full example code, and just to explain bits of it..
In your INIT Dialog Event, you need to have a line such as:
dcx Mark $dname <callback alias>
This allows the dialog to know that, when theres activity with the mouse, or keyboard involving the dialog... It will resort to reading this alias... (In basic terms)
alias cb_function {
if ($2 != mouse) echo -s $1-
}
Is your call back alias.. (You can change the name whatever suits
)
So what this above alias does is, when your dialog is open, test your dialog by clicking on buttons or typing in edit boxes, and in your status window, you will receive a DEBUG type of code, something like...
$dname sclick 1 1
So.. basically these are general ideas...
$1 == Dialogs Name ($dname)
$2 == Event (sclick, dclick, mouseenter mouseleave) etc....
$3 == Controls ID Number
In this case for the toolbar.. you may have a $4 and thats the BUttons ID on the toolbar...
So how do we put all this so something happens when I click a button....
We go back to your callback alias.. and enter the neccessary code!
alias cb_function {
if ($2 != mouse) echo -s $1-
if ($2 == sclick) {
if ($3 == 1) && ($4 == 1) echo -s Hello I clicked the button!!!
}
}
The above example is for a toolbar button, while the below example is for like a button and a toolbar!
alias cb_function {
if ($2 != mouse) echo -s $1-
if ($2 == sclick) {
if ($3-4 == 1 1) echo -s You click the Toolbar Button!
elseif ($3 == 4) You clicked a button!
}
}
Anyway, I've started to babble a bit, so I'm sure you can see and get the idea behind it!
Hope this helps!
Kind Regards,
Daniel
Edited Jan 27, 2010 10:13 AM by Dan*