Encoder dialog

By sercan386 on Oct 24, 2008

So... this is my first dialog script. ever. Have fun with it. although its quite simple.
type /encoder to start the dialog.

dialog Encoder {
  title "Encoder Dialog"
  size -1 -1 311 135
  option pixels
  edit "", 1, 7 22 209 41, autohs autovs multi return vsbar
  text "Insert the text that has to be encoded here!", 2, 5 2 218 19
  edit "", 6, 7 65 208 49, read autohs autovs multi return vsbar
  button "Exit", 7, 224 2 78 27, cancel
  text "Created by CAsercan3.", 8, 7 115 113 17
  link "www.ca-clan.tk", 9, 122 114 116 17
  radio "Mime", 10, 232 55 68 17
  radio "Uucode", 11, 232 71 68 17
  box "Type", 5, 226 41 80 56
  menu "File", 3
  item "Exit", 4, 3
}
on *:dialog:encoder:init:0: {
did -c encoder 10
  set %codelang m
}
on *:dialog:encoder:edit:1: {
  did -r encoder 6 $encode($did(encoder,1),%codelang)
  did -a encoder 6 $encode($did(encoder,1),%codelang)
}
on *:dialog:encoder:sclick:10: {
  set %codelang m
  did -r encoder 6 $encode($did(encoder,1),%codelang)
  did -a encoder 6 $encode($did(encoder,1),%codelang)
}
on *:dialog:encoder:sclick:11: {
  set %codelang u
  did -r encoder 6 $encode($did(encoder,1),%codelang)
  did -a encoder 6 $encode($did(encoder,1),%codelang)
}
on *:dialog:encoder:sclick:7: {
  dialog -x encoder encoder
}
on *:dialog:encoder:menu:4: {
  dialog -x encoder encoder
}
alias encoder dialog -m encoder encoder

Comments

Sign in to comment.
^Neptune   -  Oct 24, 2008

It'd be also nice to have it check when the dialog opens. You'd need to use the INIT event.

on *:dialog:encoder:init:0: {

This event is triggered when the dialog is opened. So, for example, you can set text to edit boxes, check radio/check boxes, add stuff to lists/combos in here. It's a very useful thing. :P

 Respond  
guest598594   -  Oct 24, 2008

Nice job on your first dialog. Here's a tip:

  did -r encoder 6 $encode($did(encoder,1),%codelang)
  did -a encoder 6 $encode($did(encoder,1),%codelang)

You can combine switches, so rather than doing two lines, you can do:

  did -ra encoder 6 $encode($did(encoder,1),%codelang)
 Respond  
sercan386   -  Oct 24, 2008

Thank you! I'll immediately update it.

 Respond  
^Neptune   -  Oct 24, 2008

Good that you're exploring what dialogs have to offer. Few suggestions:

Use /did -c $dname ID to automatically check a radio box. Also, you can have a look at the on DIALOG edit event if you want to automatically update the output box without pressing any buttons.

Good for a first dialog though.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.