Author Topic: a simple Modal Dialog box  (Read 4943 times)

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
a simple Modal Dialog box
« on: November 08, 2006, 08:34:56 pm »
Hi All,

Well, I've been able to get SE Macros to do the same thing as my previously used VS Macros (simple code insertion into an open edit file).

What I need now is a simple Modal Dialog that contains:
1) a window where the user enters a text string
2) an OK button
3) a CANCEL button

My company is using an old version of SE (v8) and the docs I have for that version are pretty pathetic.  This leads me to throw myself on the mercy of the SE community for examples.

Any input would be greatly appreciated,

Dave James

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: a simple Modal Dialog box
« Reply #1 on: November 08, 2006, 08:58:24 pm »
Take a look at the textBoxDialog function in mprompt.e

Here's a sample.
Code: [Select]
   _str initalValue = 'Change this';
   int checkValue = 1;
   int res = textBoxDialog("Sample Title", 0, 0, '', '', '', 'Sample Prompt:'initalValue, '-CHECKBOX Sample Check:'checkValue);
   if(res == 1)
   {
      message('The user chose ['_param1'] and checkbox state is '_param2);
   }

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
Re: a simple Modal Dialog box
« Reply #2 on: November 08, 2006, 09:15:17 pm »
Hi Matthew,

Thank you for the input, but (ain't there always?) the version of SE that I have (v8) doesn't support "textBoxDialog".  At least when I enter "textBoxDialog" into the Help search window, nothing is returned.

Later,

DJ

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: a simple Modal Dialog box
« Reply #3 on: November 08, 2006, 10:24:05 pm »
The textBoxDialog function was added recently. But it is simply a wrapper for using the _textbox_form dialog control, which has been around since version 7. Just search your current macro source for show("-modal _textbox_form" to scrounge for samples of invoking the dialog directly.

HINT: Where you see the -e parameter in the macros, that's specifying a data validation callback function for the specified textbox control prompt that follows.

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
Re: a simple Modal Dialog box
« Reply #4 on: November 15, 2006, 11:37:00 pm »
...will do - thanks.

DJ