function nv_setup_statusbar( ctrlentid, simplebar ) /* ---------------------------------------------------------------------------- Author : Mark Boorman Date : 18 January 2012 Version : 1.0.0.0 Purpose : Initialise a statusbar ctrlentid. Modification Info: ---------------------------------------------------------------------------- Date Who Notes ---------------------------------------------------------------------------- 121122 mab Changed the statuspane (1) to be of type normal and left aligned 'Normal' allows the left alignment and the use of paneimage 141201 mab Added simplebar parameter to set up simpler just status type statusbars 141208 mab Made progress bar colour consistent with environment settings. If no colours defined in the environment then just use the XP theme 170217 mab Changed the font of the status pane and minor tweaks Parameters: ---------------------------------------------------------------------------- ctrlentid [in] ctrlentid to initialise as a statusbar Returns: ---------------------------------------------------------------------------- result [out] True or False depending on result from SendMessage --------------------------------------------------------------------------*/ Declare function get_Property, GetEnvcolours Declare subroutine Check_Assignments, Set_Property, nv_statusbar $Insert Usercommon_ins $Insert nv_userprefs Equ ScrollPane$ to 7 Equ CapsPane$ to 6 Equ NumPane$ to 5 Equ UserPane$ to 4 Equ MarqueePane$ to 3 Equ ProgressPane$ to 2 Equ StatusPane$ to 1 Check_Assignments(ctrlentid, simplebar) nv_version$$ = "[ver: h048]" IF ctrlentid[1,5] _eqc ver$$ THEN RETURN nv_version$$ END If ctrlentid = '' then return end If simplebar then // Don't need the caps, scroll etc on every statusbar // so limit the number of panes and the rest of the initialisation will be irrelevant. NoPanes = 3 end else NoPanes = 7 end GoSub setup_statusbar Return /********************************************** * **********************************************/ setup_statusbar: EnvironColours = GetEnvcolours('') startgradient = EnvironColours<1> endgradient = EnvironColours<2> Set_Property(ctrlentid, 'OLE.PaneCount', NoPanes) Set_Property(ctrlentid, "OLE.AllowXPTheme", True$) If Not(Simplebar) then Set_Property(ctrlentid, "OLE.PaneBehavior[":CapsPane$:"]", 'Fixed') Set_Property(ctrlentid, 'OLE.PaneWidth[':CapsPane$:']', 40) Set_Property(ctrlentid, "OLE.PaneAlignment[":CapsPane$:"]", 'Center') Set_Property(ctrlentid, 'OLE.PaneType[':CapsPane$:']', 'CapLock':@FM:"DIM") Set_Property(ctrlentid, 'OLE.PaneCaption[':CapsPane$:']', 'CAPS') Set_Property(ctrlentid, "OLE.PaneBehavior[":NumPane$:"]", 'Fixed') Set_Property(ctrlentid, 'OLE.PaneWidth[':NumPane$:']', 40) Set_Property(ctrlentid, "OLE.PaneAlignment[":NumPane$:"]", 'Center') Set_Property(ctrlentid, 'OLE.PaneType[':NumPane$:']', "NumLock":@FM:"DIM") Set_Property(ctrlentid, 'OLE.PaneCaption[':NumPane$:']', 'NUM') Set_Property(ctrlentid, "OLE.PaneBehavior[":ScrollPane$:"]", 'Fixed') Set_Property(ctrlentid, 'OLE.PaneWidth[':ScrollPane$:']', 60) Set_Property(ctrlentid, "OLE.PaneAlignment[":ScrollPane$:"]", 'Center') Set_Property(ctrlentid, 'OLE.PaneType[':ScrollPane$:']', 'ScrollLock':@FM:"DIM") Set_Property(ctrlentid, 'OLE.PaneCaption[':ScrollPane$:']', 'SCROLL') Set_Property(ctrlentid, "OLE.PaneBehavior[":UserPane$:"]", 'Minimum') Set_Property(ctrlentid, 'OLE.PaneWidth[':UserPane$:']', 60) Set_Property(ctrlentid, "OLE.PaneAlignment[":UserPane$:"]", 'Center') Set_Property(ctrlentid, 'OLE.PaneCaption[':UserPane$:']', Curr_User%) end spCtrls = ctrlentid:str(rm$:ctrlentid, 3) spProps = "OLE.PaneType[":StatusPane$:"]":rm$:"OLE.PaneBorder[":StatusPane$:"]":rm$ spProps := "OLE.PaneAlignment[":StatusPane$:"]":rm$:"OLE.PaneFont[":StatusPane$:"]" spVals = "Normal":rm$:"Bevel Raised":rm$:'Left':rm$:"Segoe UI":svm$:9 Set_Property(spCtrls, spProps, spVals) * Set_Property(ctrlentid, "OLE.PaneType[":StatusPane$:"]", "Normal") * Set_Property(ctrlentid, "OLE.PaneBorder[":StatusPane$:"]", "Bevel Raised") * Set_Property(ctrlentid, "OLE.PaneAlignment[":StatusPane$:"]", 'Left') nv_statusbar('colour', ctrlentid, 'Reset', StatusPane$) Set_Property(ctrlentid, "OLE.PaneType[":ProgressPane$:"]", "Progress Percent") Set_Property(ctrlentid, "OLE.PaneBorder[":ProgressPane$:"]", "Bevel Raised") Set_Property(ctrlentid, 'OLE.PaneVisible[':ProgressPane$:']', False$) Set_Property(ctrlentid, "OLE.PaneColors[":ProgressPane$:"]", @fm:@fm:'Red':@fm:'DodgerBlue') Set_Property(ctrlentid, "OLE.PaneAlignment[":ProgressPane$:"]", 'Center') If StartGradient then // Make the progress bar colours consistent with the rest of the app ProgressBarColours = "Horizontal(Gradient(":startgradient:", ":endgradient:"), " ProgressBarColours := "Gradient(":endgradient:", ":startgradient:"))" ProgressBarColours = "LightSkyBlue" end else // No environment colours specified so just go with the XP theme ProgressBarColours = "XP" end Set_Property(ctrlentid, "OLE.PaneType[":MarqueePane$:"]", "Normal") * Set_Property(ctrlentid, "OLE.PaneColors[":MarqueePane$:"]", @fm:@fm:@fm:'XP') Set_Property(ctrlentid, "OLE.PaneColors[":MarqueePane$:"]", @fm:@fm:@fm:ProgressBarColours) Set_Property(ctrlentid, "OLE.PaneMarqueeDelay[":MarqueePane$:"]", 0) Set_Property(ctrlentid, "OLE.PaneBorder[":MarqueePane$:"]", "Bevel Raised") * Set_Property(ctrlentid, "OLE.PaneBorder[All]", "Bevel Raised") Return