Ignore:
Timestamp:
Sep 7, 2008, 8:34:08 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

adding skin support (incomplete)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/tmg-cprs/CPRS-Chart/fFrame.pas

    r473 r487  
    1717  OleCtrls, VERGENCECONTEXTORLib_TLB, ComObj, AppEvnts, inifiles,
    1818  //kt mod 6/29/07 -----
     19  {$IFDEF USE_SKINS}
     20  ipSkinManager,//kt 9/7/08
     21  {$ENDIF}
    1922  fWebTab,
    2023  DKLang, TntForms, TntStdCtrls, TntSystem, TntSysUtils;
     
    369372  public
    370373    EnduringPtSelSplitterPos: integer;
     374    SkinAtStartup : boolean; //kt 9/8/08
     375    CurrentSkinFile : string; //kt 9/8/08
     376    {$IFDEF USE_SKINS}
     377    SkinManager : TipSkinManager;
     378    {$ENDIF}
     379    procedure ActivateCurrentSkin; //kt 9/8/08
     380    procedure InactivateSkin; //kt 9/8/08
    371381    procedure SetBADxList;
    372 
    373382    function PageIDToTab(PageID: Integer): Integer;
    374383    procedure ShowHideChartTabMenus(AMenuItem: TMenuItem);
     
    815824  if tempPosition > tpRight then tempPosition := tpBottom;
    816825  fOptionsOther.SetTabPosition(tempPosition);
     826  {$IFDEF USE_SKINS}
     827  SkinManager := TipSkinManager.Create(self);
     828  {$ENDIF}
     829  SkinAtStartup := CPRSChartINI.ReadBool('Skin','Load At Startup',false);
     830  CurrentSkinFile := CPRSChartINI.ReadString('Skin','Default Skin','TMG_Extra\Skins\ICQ_Longhorn_v.1.2.ipz');
     831  if SkinAtStartup then ActivateCurrentSkin;
    817832  //kt -- end mod --
    818833
     
    9861001  CPRSChartINI.Free;  //kt added 8/8/08
    9871002end;
     1003
     1004procedure TfrmFrame.ActivateCurrentSkin;
     1005begin
     1006  {$IFDEF USE_SKINS}
     1007  SkinManager.SkinFile := ExtractFilePath (Application.ExeName) + CurrentSkinFile;
     1008  if FileExists(SkinManager.SkinFile)=false then begin
     1009    SkinManager.SkinFile := '';
     1010  end;
     1011  if SkinManager.SkinFile <>'' then begin
     1012    try
     1013      SkinManager.Active := true;
     1014    except
     1015      on EInvalidOperation do begin
     1016        MessageDlg('Error Applying Skin.  Please try another.',mtInformation,[mbOK],0);
     1017      end;
     1018      else  begin
     1019        MessageDlg('Error Applying Skin.  Please try another.',mtInformation,[mbOK],0);
     1020      end;
     1021    end;
     1022  end else begin
     1023    SkinManager.Active := false;
     1024  end;
     1025  {$ENDIF}
     1026end;
     1027
     1028procedure TfrmFrame.InactivateSkin;
     1029begin
     1030  {$IFDEF USE_SKINS}
     1031  SkinManager.Active := false;
     1032  {$ENDIF}
     1033end;
     1034
    9881035
    9891036procedure TfrmFrame.RenameTabs;    //kt added entire function;
Note: See TracChangeset for help on using the changeset viewer.