Kirby commented on a Page, Hotstring  -  Feb 07, 2009

Some things I would like to note:

  • Radios
  if ($did == 7) { set %hs 1 }
  if ($did == 10) { set %hs 0 }

You can use $did(id).state and some $iif's to see whether something is checked or not, and perform various actions on each check, without the use of variables. Also note that those variables can easily be unset. So normally, you wouldn't need to perform an action when you sclick on those $did's (radios, checkboxes, etc).

  • Aliases
    The first alias that I see is:
alias hs { dialog $iif($dialog(hs),-v,-dom) hs hs hs | if (!%hs) { set %hs 0 } }

As I said earlier, you wouldn't need variables for radios. Also, to open a dialog, you only need two dialog id's after the $iif. So you can basically recode this as:

alias hs dialog $iif($dialog(hs),-v,-dom) hs hs

This might be my habit, but I find it awkward to have multiple aliases pertaining to the script that perform different functions.
I see three different aliases:

alias hs.load, hs.replace, hs.txt

Kinda confused me, but I guess you can ignore me on this part and leave it alone.

  • Dialog
    No offense but, this dialog is fugly.
    I am sorry, I apologize.

You said earlier that you don't want to use DSTUDIO (for unknown reasons to me), but I'll say some things:
[list]

  • DSTUDIO makes dialogs look much nicer and it's easier to edit.
  • DSTUDIO saves you time.
    You may disagree with me because this is a small dialog, but if you were to code a larger dialog as I did with my Microsoft Agent dialog, DSTUDIO significantly lowers the time to create a dialog by several minutes...even hours.

On the bright side, you can improve upon things.
In my opinion, I didn't like the edit box directly underneath the list box.
I also didn't like the initiation text event; I thought it was a little useless, and you can cut that large space out.
This is only one opinion, and you can reject this idea if you wish.

Below I've recoded the dialog to what fits me the best, but again, you can ignore me if you want.

dialog hs {
  title "Hotstring v0.2"
  size -1 -1 151 84
  option dbu
  text "Resulting text:", 1, 86 9 37 8
  text "Hotstring(s):", 2, 16 9 31 8
  list 3, 7 19 51 57, size
  edit "", 4, 67 19 74 11, read
  button "Add", 5, 64 40 35 10
  button "Remove", 6, 109 40 35 10
  radio "On", 7, 81 60 18 10
  radio "Off", 8, 110 60 19 10
  box "Hotstring Configuration", 9, 4 1 144 80
}

I just thought this made it look a little "cleaner".
[/list]

That's really all I have to say.
Keep on going; I like the idea of this script.

 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.