Hi,
As an addition to the little splitter project Michael Drechsler initiated, there's now a possibility to store the splitter position. You can download it
here.
Because the splitting is all done in browser code the server does not "know" what position the splitter has.
So we need some Ajax to pass it to the server.
I created a server procedure, Ajax enabled, as follows:
PROCEDURE Save_SplitterPos(nPos)
INIWrite("store","splitter",NumToString(nPos),fExeDir()+"\settings.ini")
The storing is done in an ini file for simplicity reasons, but you may want to change that to a database or any other more convenient way.
When the page is closed, we call this Ajax procedure in the browser Unload (on unload) code:
AJAXExecute(Save_SplitterPos,BTN_Splitter..X)
When the page is called we need to read (in the page global declarations or initialization code) the last position of the splitter:
nSplitterPos=Val(INIRead("store","splitter","0",fExeDir()+"\settings.ini"))
nSplitterPos is a global int.
Now in the onload (browser) code of the page we set the splitterpos and do a call to the Move_Splitter procedure:
IF nSplitterPos<>0 THEN
bMoving=True //set the global boolean to true to enable the move
Move_Splitter(nSplitterPos) //do the move
bMoving=False //reset the global boolean to false to stop move mode.
END
CELL_Left..Height=ZONE_Body..Height-10
CELL_Right..Height=ZONE_Body..Height-10
CELL_Right..Width=ZONE_Body..Width-CELL_Left..Width-50
That's it, happy developping,
Piet
Edited 1 time(s). Last edit at 02/05/2013 12:44AM by Piet van Zanten.