Author Topic: Dynamic forms in Slickedit  (Read 76 times)

jennycooper

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Dynamic forms in Slickedit
« on: July 14, 2018, 12:25:39 am »
hii,
I want to know if we can create dynamic dialog boxes in slickedit by reading the the value of form elements from an external file (.txt file) . If yes , how ??
________________________________________________________________________________________
jennycooper
Nox Showbox Vidmate


« Last Edit: July 15, 2018, 03:49:39 pm by jennycooper »

Graeme

  • Senior Community Member
  • Posts: 2117
  • Hero Points: 257
Re: Dynamic forms in Slickedit
« Reply #1 on: July 14, 2018, 07:05:05 am »
Yes it's possible.  There's three ways. 
(1)
Have a look at the code here
https://community.slickedit.com/index.php/topic,16128.msg61929.html#msg61929
and also search slick macro sources for create_window.

(2)
Search the help for textBoxDialog - it's a function you can call that displays a form with checkboxes, editboxes and buttons according to what you pass to the textBoxDialog function.  You use global variables _param1 _param2 etc to get results from the form.  Have a look at the "standard dialogs" section of SlickCMacroBestPractices.pdf in the installation docs folder.

(3)
You can generate some code that represents a form, then load that code.  e.g. below is the code for one of my forms.  Use the form designer - on the macro menu select new form.  Then put whatever gui elements you might need, including event handlers.  After your form is created, use the "insert form or macro source" command on the macro menu to get the source code that represents the form.  From that, you can see what you need to do to dynamically generate a form.  i.e. you need to create a slick C source file that has
#include "slick.sh"
at the top followed by event handlers and the source code for the form.
You then have to load that source code to get the form built  - to do that, you call the load function e.g.
load("yourfilename.e")
Then you use the "show" command to show the form.

Code: [Select]
_form xbar1 {
   p_backcolor=0x80000005;
   p_border_style=BDS_NONE;
   p_caption="xs";
   p_forecolor=0x80000008;
   p_height=6000;
   p_tool_window=true;
   p_width=3825;
   p_x=14925;
   p_y=1890;
   p_eventtab=xbar1;
   _list_box ctllist1 {
      p_border_style=BDS_FIXED_SINGLE;
      p_font_size=1;
      p_height=5460;
      p_multi_select=MS_NONE;
      p_scroll_bars=SB_NONE;
      p_tab_index=1;
      p_tab_stop=true;
      p_width=900;
      p_x=0;
      p_y=0;
      p_eventtab2=_ul2_listbox;
   }
   _image scrollbar_image {
      p_auto_size=false;
      p_backcolor=0x80000005;
      p_border_style=BDS_NONE;
      p_forecolor=0x80000008;
      p_height=5040;
      p_max_click=MC_SINGLE;
      p_Nofstates=1;
      p_picture='';
      p_stretch=true;
      p_style=PSPIC_DEFAULT;
      p_tab_index=2;
      p_tab_stop=false;
      p_value=0;
      p_width=780;
      p_x=600;
      p_y=360;
      p_eventtab2=_ul2_imageb;
   }
   _image current_line_image {
      p_auto_size=false;
      p_backcolor=0x00A8A8A8;
      p_border_style=BDS_NONE;
      p_forecolor=0x80000008;
      p_height=120;
      p_max_click=MC_SINGLE;
      p_Nofstates=1;
      p_picture='';
      p_stretch=false;
      p_style=PSPIC_DEFAULT;
      p_tab_index=4;
      p_tab_stop=false;
      p_value=0;
      p_width=780;
      p_x=300;
      p_y=5100;
      p_eventtab2=_ul2_imageb;
   }
   _image scrollbar_handle_image {
      p_auto_size=false;
      p_backcolor=0x00A8A8A8;
      p_border_style=BDS_NONE;
      p_forecolor=0x00D70625;
      p_height=960;
      p_max_click=MC_SINGLE;
      p_Nofstates=1;
      p_picture='';
      p_stretch=false;
      p_style=PSPIC_DEFAULT;
      p_tab_index=3;
      p_tab_stop=false;
      p_value=0;
      p_width=840;
      p_x=180;
      p_y=4080;
      p_eventtab2=_ul2_imageb;
   }
}