I am using the below code to navigate through pages. Is there any alternative or better way of getting the same result? The slider seems to be too big. I don't have more than 10 pages
Page = 1; // your page index
idSlider = 1;
function CreateGUI()
{
if( GuiSlider( idSlider, 10, 30, 200, 30, notifyEditChange ) == guiNew )
{
// init values on control creation
GuiSetValue( idSlider, Page );
GuiSetRange( idSlider, 1, 10, 1, 1 );
}
}
function HandleEvents()
{
for( n = 0; id = GuiGetEvent( n, 0 ); n++ ) // get the id of the event
{
code = GuiGetEvent( n, 1 );
switch( id )
{
case idSlider:
// do something
Page = GuiGetValue( idSlider );
break;
// ... handle other GUI controls
default:
break;
}
}
}
CreateGUI();
HandleEvents();
Title = "Page: " + Page;
As you can see, you need to set the slider range when you create it (please, apply the above sample code to a new chart or pane).
I don't know if it's a good idea to use a slider to change pages. I would probably use 10 small GUI buttons.