Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What is the last letter in the word "SlickEdit":
How many LETTERS are in the following? "a1b2c3":
Which number is missing?  "12345689":

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Graeme
« on: September 05, 2015, 06:39:29 AM »

I'd like to request the addition of save_named_layout, load_named_layout functions along the lines of the existing macros save_named_state and load_named_state.  I use a version of save_named_layout as below which differs from save_named_state only in the call to restore2 (plus the .slk filename)which sets the third argument false to stop files/buffers from being restored.
Also it would be useful to have some comments added to save_named_state to explain what it does ... plus, it doesn't restore a docked defs tool-window correctly for me.  It's still useful though.

Code: [Select]
_command void load_named_layout(_str sectionName="") name_info(',')
{
   filename := _ConfigPath():+'windowstate_nobuffers.slk';
   if ( sectionName=="" ) {
      _ini_get_sections_list(filename,auto sectionList);
      result := show('-modal _sellist_form',
                     "Load Named State",
                     SL_SELECTCLINE,
                     sectionList,
                     "Load,&Delete",     // Buttons
                     "Load Named State", // Help Item
                     "",                 // Font
                     _load_named_layout_callback
                     );
      if ( result=="" ) {
         return;
      }
      sectionName = result;
   }
   status := _ini_get_section(filename,sectionName,auto tempWID);
   if ( status ) return ;
   origWID := p_window_id;
   p_window_id = tempWID;
   //_close_all2();
   //p_window_id = tempWID;
   restore2('', '', false, true, true);
   if ( _iswindow_valid(origWID) ) {
      p_window_id = origWID;
   }
   _delete_temp_view(tempWID);
}