%ffp /* ============================================================= Standalone filter information ============================================================= */ Category: "FM" Title: "Tab-style Demo" Copyright: "Freeware" Author: "Wm. G. MacBeth" Filename: "TabDialog.8bf" Description: "Illustrates how a tab-style\n" "dialog box can be constructed." Version: "0.1" About: "!T !V\n!D\n" "!c\n!A" Dialog: "Tab-style Dialog Box Demo", color= RGB (212,208,200) /* ============================================================= Dialog box definition Ctl(0) through ctl(4) are used to construct the "tabs." Ctl(4) is dynamically repositioned to cover the gap between two controls to give the appearance of a whole tab page. Ctl(5) is the Help pushbutton and ctl(6) through ctl(8) are the controls that are unique to each tab. Ctl(9) is the key to making it all work. It is invisible, with its value dynamically set to remember the current tab page, independent of successive actuation of the other controls. ============================================================= */ /* ============================================================= Support for Large System Fonts and coloring of the disabled tab buttons by Harald Heim ============================================================= */ ctl[0]: statictext(modalframe,center,notify), pos=(180,9),size=(50,13), text="General",fontcolor=black, color = RGB(212,208,200) ctl[1]: statictext(modalframe,center,notify), pos=(230,9),size=(50,13), text="Special",fontcolor=black, color=RGB(220,220,220) ctl[2]: statictext(modalframe,center,notify), pos=(280,9),size=(50,13), text="Other",fontcolor=black, color=RGB(220,220,220) ctl[3]: statictext(modalframe), pos=(180,20),size=(200,77), color=RGB(220,220,220) ctl[4]: ownerdraw,pos=(181,18),size=(47,4),color=RGB (212,208,200)//RGB(192,192,192) ctl[5]: pushbutton,pos=(181,126), text="Help",fontcolor=#000000 ctl[9]: scrollbar,invisible,val=1 ctl[6]: standard,pos=(240,30), text="Tab 1 Control",fontcolor=#C00000, range=(0,30),val=15 ctl[7]: standard,invisible,pos=(240,30), text="Tab 2 Control",fontcolor=#00A000, range=(0,60),val=30 ctl[8]: standard,invisible,pos=(240,30), text="Tab 3 Control",fontcolor=#0000FF, range=(0,90),val=45 ctl[16]: standard,pos=(240,40), text="Tab 4 Control",fontcolor=#C00000, range=(0,30),val=20 ctl[17]: standard,invisible,pos=(240,40), text="Tab 5 Control",fontcolor=#00A000, range=(0,60),val=25 ctl[18]: standard,invisible,pos=(240,40), text="Tab 6 Control",fontcolor=#0000FF, range=(0,90),val=29 ctl[26]: standard,pos=(240,50), text="Tab 7 Control",fontcolor=#C00000, range=(0,30),val=15 ctl[27]: standard,invisible,pos=(240,50), text="Tab 8 Control",fontcolor=#00A000, range=(0,60),val=30 ctl[28]: standard,invisible,pos=(240,50), text="Tab 9 Control",fontcolor=#0000FF, range=(0,90),val=45 OnCtl(n):{ //Adapt to Large Font if (VDBUsToPixels(10)==20) setCtlPos(3,-1,21,-1,-1); enableCtl(6,0); // Initialize the dialog box to Tab 1 enableCtl(7,0); enableCtl(8,0); enableCtl(5+ctl(9),-1); if (n==0 && e == FME_CLICKED) { enableCtl(6,-1); // update display of controls enableCtl(7,0); enableCtl(8,0); enableCtl(16,-1); // update display of controls enableCtl(17,0); enableCtl(18,0); enableCtl(26,-1); // update display of controls enableCtl(27,0); enableCtl(28,0); setCtlColor(0,RGB (212,208,200)); setCtlColor(1,RGB(220,220,220)); setCtlColor(2,RGB(220,220,220)); setCtlVal(9,1); // update tab counter setCtlVal(0,false); // clear the Tab 1 control } else if (n==1 && e == FME_CLICKED) { enableCtl(6,0); enableCtl(7,-1); enableCtl(8,0); enableCtl(16,0); enableCtl(17,-1); enableCtl(18,0); enableCtl(26,0); enableCtl(27,-1); enableCtl(28,0); setCtlVal(9,2); setCtlColor(1,RGB (212,208,200)); setCtlColor(0,RGB(220,220,220)); setCtlColor(2,RGB(220,220,220)); setCtlVal(1,false); } else if (n==2 && e == FME_CLICKED) { enableCtl(6,0); enableCtl(7,0); enableCtl(8,-1); enableCtl(16,0); enableCtl(17,0); enableCtl(18,-1); enableCtl(26,0); enableCtl(27,0); enableCtl(28,-1); setCtlVal(9,3); setCtlColor(2,RGB (212,208,200)); setCtlColor(0,RGB(220,220,220)); setCtlColor(1,RGB(220,220,220)); setCtlVal(2,false); } else if (n==5 && e == FME_CLICKED) { switch ( ctl(9) ) // switch, based on tab number { case 1: msgBox(MB_OK,"","This is the help\nfor tab1"); break; case 2: msgBox(MB_OK,"","This is the help\nfor tab2"); break; case 3: msgBox(MB_OK,"","This is the help\nfor tab3"); break; default: break; } setCtlVal(5,false); // clear the Help button } setCtlPos(4,131+50*ctl(9),19,47,4); return true; }//OnCtl() OnFilterStart:{ //Adapt to Large Font if (VDBUsToPixels(10)==20) setCtlPos(3,-1,21,-1,-1); setCtlPos(4,131+50*ctl(9),19,47,4); return false; }//OnFilterStart ForEveryTile: { for ( y=0; y