//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : thstatusBar.pkg // $ProjectName : The Hammer 2.0 // $Authors : Wil van Antwerpen, Michael Kurz, Sergey V. Natarov // $Created : 01.25.2014 01:08 // $Type : LGPL // // Contents: The Hammer Status bar // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // 07/23/96 JJT - New Class names // Very prototype global status bar // //Use dfAstbar.pkg Use cStatusBar.pkg Enum_List Define SB_Position For 1 Define SB_OvrIns For 2 // Overwrite/Insert indicator Define SB_Workspace For 3 Define SB_Language For 4 Define SB_FindFiles For 5 Define SB_ShowMethod For 6 End_Enum_List Object Status_Bar Is a cStatusBar Object oMicroHelp Is a cStatusPane Set piWidth To 1 Set psLabel To "" Set peBevel To bsNone End_Object // bsLowered -- bsRaised -- bsNone Object oIcon Is a cStatusPane Set piWidth To 20 Set psLabel To "" Set peBevel To bsNone Set psIcon To "tbmessages.ico" Procedure OnClick Set pbErrorListVisible Of ghoEditorProperties To (Not(pbErrorListVisible(ghoEditorProperties))) Send PAWindowErrorListONOFF (pbErrorListVisible(ghoEditorProperties)) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oPosition Is a cStatusPane // SB_Position Set piWidth To 120 Set psLabel To "" Set peBevel To bsLowered Set peAlignment To asCenter Procedure OnClick Send GotoLine To (Focus(DeskTop)) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oOvrIns Is a cStatusPane // SB_OvrIns Set piWidth To 30 Set psLabel To "" Set peBevel To bsLowered Set peAlignment To asCenter Procedure OnClick Send Toggle_Overtype To (Focus(DeskTop)) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oWorkspace Is a cStatusPane // SB_Workspace Set piWidth To 230 Set psLabel To "" Set peBevel To bsLowered Procedure OnClick Send Popup To (oWorkSpace(Focus(DeskTop))) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oLanguage Is a cStatusPane // SB_Language Set piWidth To 50 Set psLabel To "" Set peBevel To bsLowered Set peAlignment To asCenter Procedure OnClick Send Properties To (Focus(DeskTop)) // Send Activate_oParas To (Focus(DeskTop)) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oIcon Is a cStatusPane // SB_FindFiles Set piWidth To 23 Set psLabel To "" Set peBevel To bsLowered Set psIcon To "tbfindfiles.ico" Procedure OnClick If (Active_State(oFindFiles(oClientArea(Self)))) Send Deactivate To (oFindFiles(oClientArea(Self))) Else Send PopUp To (oFindFiles(oClientArea(Self))) End_Procedure Procedure OnDoubleClick End_Procedure End_Object Object oMethod Is a cStatusPane // SB_ShowMethod Set piWidth To 600 Set psLabel To "" Set peBevel To bsLowered End_Object Procedure Set Value Integer iItem String sValue If (iItem<1) Procedure_Return If (iItem=SB_Position) Set psLabel Of oPosition To sValue If (iItem=SB_OvrIns) Set psLabel Of oOvrIns To sValue If (iItem=SB_Workspace) Set psLabel Of oWorkspace To sValue If (iItem=SB_Language) Set psLabel Of oLanguage To sValue If (iItem=SB_FindFiles) Set psIcon Of oIcon To sValue If (iItem=SB_ShowMethod) Set psLabel Of oMethod To sValue End_Procedure Procedure Show_View_Name String sName //Set Value Item 1 To sName // End_Procedure // // Override on getting background color as the change from default color to -1 // gives a black background on Vista/Windows 2008 based OS's with aero turned off. // Function ConvertSystemColor Integer iColor Returns Integer Integer iSysColor If (iColor = clDefault or iColor = clNone) Begin // If default color then use -1 //Move clNone to iColor End Else If (iColor < 0) Begin // If it is a system color (<0) then convert this into an RGB value Move (iColor iand |CI$7FFFFFFF) to iSysColor // extract the system color constant Move (GetSysColor(iSysColor)) to iColor End Function_Return iColor End_Function End_Object Procedure ClearStatusInfos Set value Of Status_Bar Item SB_Position To "" Set value Of Status_Bar Item SB_OvrIns To "" End_Procedure Procedure ShowCursorPosition Integer iLine Integer iCol String sLine Append sLine " Ln " (iLine+1) ", " "Col " (iCol+1) Set value Of Status_Bar Item SB_Position To sLine End_Procedure Procedure ShowInsert Integer iMode If iMode Set value Of Status_Bar Item SB_OvrIns To "INS" Else Set value Of Status_Bar Item SB_OvrIns To "OVR" End_Procedure Procedure ShowMethodInfo String sLine Set value Of Status_Bar Item SB_ShowMethod To sLine End_Procedure Procedure ShowLanguageInfo String sLanguage Number nVersion If (sLanguage="VDF") Begin Get fnCurrentVdfVersion Of ghoWorkSpaceHandlerEx To nVersion If (nVersion>=180) Begin Move ("DataFlex") To sLanguage End End Set value Of Status_Bar Item SB_Language To sLanguage End_Procedure // ShowLanuageInfo Procedure ShowWorkspaceInfo String sInfo String sVersion Number nVersion Get CurrentWorkspaceDescription Of ghoWorkSpaceHandlerEx To sInfo Get psVdfVersion Of ghoWorkSpaceHandlerEx To sVersion Get fnCurrentVdfVersion Of ghoWorkSpaceHandlerEx To nVersion If (nVersion<180) Begin Move (sInfo*"(VDF"*sVersion+")") To sInfo End Else Begin Move (sInfo*"(DF"*sVersion+")") To sInfo End Set value Of Status_Bar Item SB_Workspace To sInfo Set value Of Status_Bar Item SB_Language To (psLanguage(ghoEditorProperties)) End_Procedure