Ignore:
Timestamp:
Aug 8, 2008, 8:34:55 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Added Colorful Tabs, Changable Tab positions, Demographics translation enabled

File:
1 edited

Legend:

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

    r453 r473  
    3939    btnEncDefaults: TButton;
    4040    DKLanguageController1: TDKLanguageController;
     41    TabPositionComboBox: TComboBox;
     42    Label1: TLabel;
     43    Label2: TLabel;
     44    pnlShowColor: TPanel;
     45    ColorDialog: TColorDialog;
     46    Label3: TLabel;
     47    cboTabColors: TComboBox;
    4148    procedure FormShow(Sender: TObject);
    4249    procedure btnOKClick(Sender: TObject);
     
    5057    procedure txtEncStopExit(Sender: TObject);
    5158    procedure btnEncDefaultsClick(Sender: TObject);
     59    procedure TabPositionComboBoxChange(Sender: TObject);
     60    procedure cboTabColorsChange(Sender: TObject);
     61    procedure pnlShowColorClick(Sender: TObject);
    5262  private
    5363    { Private declarations }
     
    6676  ENC_MAX_LIMIT = 999;
    6777
    68  
     78
    6979procedure DialogOptionsOther(topvalue, leftvalue, fontsize: integer; var actiontype: Integer);
     80procedure SetTabPosition(Position : TTabPosition);
    7081
    7182implementation
     
    7485
    7586uses
    76   rOptions, uOptions, rCore, rSurgery, uConst, fMeds;
     87  rOptions, uOptions, rCore, rSurgery, uConst, fMeds, fFrame;
    7788
    7889procedure DialogOptionsOther(topvalue, leftvalue, fontsize: integer; var actiontype: Integer);
     
    110121  values, tab: string;
    111122begin
    112   cboTab.Items.Assign(rpcGetOtherTabs);
     123  cboTabColors.Items.Assign(uTabColorsList);  //kt added8808
     124  cboTabColors.ItemIndex := 0;      //kt
     125  cboTab.Items.Assign(rpcGetOtherTabs);   //kt
     126 cboTabColorsChange(nil);   //kt
    113127//if (cboTab.Items.IndexOf('Surgery') > -1) and (not ShowSurgeryTab) then  <-- original line.  //kt 8/8/2007
    114128  if (cboTab.Items.IndexOf(DKLangConstW('fOptionsOther_Surgery')) > -1) and (not ShowSurgeryTab) then //kt added 8/8/2007
     
    282296end;
    283297
     298procedure TfrmOptionsOther.TabPositionComboBoxChange(Sender: TObject);
     299//kt added 8/8/08
     300begin
     301  Case TabPositionComboBox.ItemIndex of
     302    0 : SetTabPosition(tpBottom);
     303    1 : SetTabPosition(tpTop);
     304    2 : SetTabPosition(tpLeft);
     305    3 : SetTabPosition(tpRight);
     306  end; {case}
     307end;
     308
     309procedure SetTabPosition(Position : TTabPosition);
     310//kt added 8/8/08
     311begin
     312  frmFrame.tabPage.TabPosition := Position;
     313  Case Position of
     314    tpBottom : frmFrame.tabPage.Align := alBottom;
     315    tpTop: frmFrame.tabPage.Align := alTop;
     316    tpLeft: frmFrame.tabPage.Align := alLeft;
     317    tpRight : frmFrame.tabPage.Align := alRight;
     318  end; {case}
     319end;
     320
     321
     322procedure TfrmOptionsOther.cboTabColorsChange(Sender: TObject);
     323var color : TColor;
     324    selIndex : integer;
     325begin
     326  selIndex := cboTabColors.ItemIndex;
     327  if selIndex < 0 then exit;
     328  color := TColor(cboTabColors.Items.Objects[selIndex]);
     329  pnlShowColor.Color := color;
     330end;
     331
     332procedure TfrmOptionsOther.pnlShowColorClick(Sender: TObject);
     333//kt added 8/8/08
     334var s : string;
     335    selIndex : integer;
     336begin
     337  if ColorDialog.Execute then begin
     338    pnlShowColor.Color := ColorDialog.Color;
     339    selIndex := cboTabColors.ItemIndex;
     340    if selIndex < 0 then exit;
     341    cboTabColors.Items.Objects[selIndex] := pointer(ColorDialog.Color);
     342    uTabColorsList.Objects[selIndex] := pointer(ColorDialog.Color);
     343  end;
     344end;
     345
    284346end.
Note: See TracChangeset for help on using the changeset viewer.