mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
hi im new to dialogs and using DialogStudio

was just wondering exactly how i would make a button where

if ( ($group(#bla) = on) && (!$timer(bla)) { Button Text = Disable }

else { Button Text = Enable }

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Set two buttons with the same location and size, one the Enable text, the other with the Disable text, then based on the your example

dialog new_table {
title "New Project"
size -1 -1 335 160
option dbu
button "Enable", 1, 5 5 35 12
button "Disable", 2, 5 5 35 12
}
on *:dialog:new_table :init:*:{
if $group(#bla).status && !$timer(bla) {
did -ev $dname 2
did -bh $dname 1
}
else {
did -ev $dname 1
did -bh $dname 2
}
}

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
While waiting for someone I had some time to kill, so I added to RusselB's
Code:

dialog new_table {
  title "New Project"
  size -1 -1 90 20
  option dbu
  button "Enable", 1, 5 5 35 12
  button "Disable", 2, 45 5 35 12
}

on *:dialog:new_table:init:*:{
  if ($group(#bla).status == off) && (!$timer(bla)) {
    did -ev $dname 1
    did -bh $dname 2
  }
  else {
    did -ev $dname 2
    did -bh $dname 1
  }
}

on *:dialog:new_table:sclick:1:{
  enable #bla 
  .timerbla 0 1 .echo -a $($chr(36) $+ group(#bla).status,0) is3 $upper($group(#bla).status)
  did -ev $dname 2
  did -bh $dname 1
}

on *:dialog:new_table:sclick:2:{
  disable #bla 
  .timerbla off
  did -ev $dname 1
  did -bh $dname 2
  .echo -a $chr(36) $+ group(#bla).status is4 $upper($group(#bla).status)
}

#bla off
no actual code
#bla end


Link Copied to Clipboard