Ignore:
Timestamp:
May 8, 2015, 7:52:55 AM (10 years ago)
Author:
healthsevak
Message:

Committing the files for first time to this new branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/HealthSevak-CPRS/CPRS-Chart/Templates/fTemplateDialog.pas

    r829 r1693  
    2828    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    2929    procedure FormShow(Sender: TObject);
     30    procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
     31      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    3032  private
    3133    FFirstBuild: boolean;
     
    7173procedure CheckBoilerplate4Fields(SL: TStrings; const CaptionText: string = ''; PreviewMode: boolean = FALSE); overload;
    7274procedure CheckBoilerplate4Fields(var AText: string; const CaptionText: string = ''; PreviewMode: boolean = FALSE); overload;
     75procedure ShutdownTemplateDialog;
    7376
    7477var
     
    8184
    8285{$R *.DFM}
     86
     87var
     88  uTemplateDialogRunning: boolean = false;
    8389
    8490const
     
    289295end;
    290296
     297procedure ShutdownTemplateDialog;
     298begin
     299  if uTemplateDialogRunning and assigned(frmTemplateDialog) then
     300  begin
     301    frmTemplateDialog.Silent := True;
     302    frmTemplateDialog.ModalResult := mrCancel;
     303  end;
     304end;
     305
    291306procedure CheckBoilerplate4Fields(SL: TStrings; const CaptionText: string = ''; PreviewMode: boolean = FALSE);
    292307begin
     
    689704procedure TfrmTemplateDialog.FormCreate(Sender: TObject);
    690705begin
     706  uTemplateDialogRunning := True;
    691707  FFirstBuild := TRUE;
    692708  BuildIdx := TStringList.Create;
     
    695711  FOldHintEvent := Application.OnShowHint;
    696712  Application.OnShowHint := AppShowHint;
    697   ResizeAnchoredFormToFont(Self);
     713  //ResizeAnchoredFormToFont(Self);
    698714  FMaxPnlWidth := FontWidthPixel(sbMain.Font.Handle) * MAX_ENTRY_WIDTH; //AGP change Template Dialog to wrap at 80 instead of 74
    699715  SetFormPosition(Self);
     716  ResizeAnchoredFormToFont(Self);
    700717  SizeFormToCancelBtn();
    701718end;
     
    720737  Entries.Free;
    721738  BuildIdx.Free;
     739  uTemplateDialogRunning := False; 
     740end;
     741
     742procedure TfrmTemplateDialog.FormMouseWheel(Sender: TObject; Shift: TShiftState;
     743  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
     744begin
     745  If RectContains(sbMain.BoundsRect, SbMain.ScreenToClient(MousePos)) then
     746  begin
     747    ScrollControl(sbMain, (WheelDelta > 0));
     748    Handled := True;
     749  end;
    722750end;
    723751
Note: See TracChangeset for help on using the changeset viewer.