⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseform.pas

📁 用户名:SYSTEM 密码:空 第一次运行请先恢复数据库 DATABASE 到SQL服务器
💻 PAS
字号:
unit BaseForm;

interface

uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,  StdCtrls, Buttons, ExtCtrls, DBCtrls, DBGrids,
  wwdblook, Mask, wwdbedit, Wwdotdot, Wwdbcomb, Grids, Wwdbigrd, Wwdbgrid,
  ComCtrls, wwdbdatetimepicker, PRGICO,DataMod,db;

type
  TfBaseForm = class(Tfprgico)
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
       AccessRight:TRights;
  end;

var
  fBaseForm: TfBaseForm;

implementation
 uses
      BaseMainform;
{$R *.dfm}

procedure TfBaseForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  inherited;
case key of
  13,vk_down:
     begin
       if activecontrol is TwwDBGrid then
          exit;
       if activecontrol is TDBGrid then
          Exit;
       if activecontrol is TwwDBLookupCombo then
          begin
             TwwDBLookupCombo(activecontrol).dropdown;
             if key=13 then
              begin
                 TwwDBLookupCombo(activecontrol).CloseUp (true)   ;
                 key:=0;
                 selectnext(Activecontrol,true,true);
            end;
            exit;
          end;

        if activecontrol is tdblookupcombobox then
          begin
             tdblookupcombobox(activecontrol).dropdown;
             if key=13 then
              begin
                 tdblookupcombobox(activecontrol).CloseUp (true)   ;
                 key:=0;
                 selectnext(Activecontrol,true,true);
            end;
            exit;
          end;
        if (activecontrol is Tcustomcombobox)  then
           begin
             if not((activecontrol as Tcustomcombobox).droppeddown)  then
                begin
                  key:=0;
                  selectnext(Activecontrol,true,true);
                 end;
            end
         else  if not(activecontrol is Tdbgrid) and not (activecontrol is Tdbmemo) then
            begin
              key:=0;
              selectnext(Activecontrol,true,true);
            end;
       end;
   vk_up:
      begin
       if activecontrol is TwwDBGrid then
          exit;
       if activecontrol is TDBGrid then
          Exit;
       if activecontrol is TwwDBLookupCombo then
          begin
            if key=13 then
              begin
                 TwwDBLookupCombo(activecontrol).CloseUp (true)   ;
                 key:=0;
                 selectnext(Activecontrol,false,true);
            end;
            exit;
          end;


         if activecontrol is tdblookupcombobox then
          begin
             tdblookupcombobox(activecontrol).DropDown ;
             exit;
          end;
        if (activecontrol is Tcustomcombobox) then
           begin
             if not((activecontrol as Tcustomcombobox).droppeddown) then
                begin
                  key:=0;
                  selectnext(Activecontrol,false,true);
                 end;
            end
        else if not(activecontrol is Tdbgrid) and  not (activecontrol is Tdbmemo) then
           begin
             key:=0;
             selectnext(Activecontrol,false,true);
           end;
      end;
      $11:
      begin
        if (activecontrol is Tcustomcombobox) then
           if not (activecontrol as Tcustomcombobox).droppeddown then
              (activecontrol as Tcustomcombobox).droppeddown:=true;
        if (activecontrol is tdblookupcombobox) then
               tdblookupcombobox(activecontrol).dropdown ;

      end;
     end;

end;

procedure TfBaseForm.FormActivate(Sender: TObject);
var
   temDataSource:TObject;
begin
  inherited;
  temDataSource:=FindComponent('DataSource');
  if temDataSource is TDataSource then
      tfBaseMainform(application.MainForm).wwDBNavigator.DataSource:=TDataSource(temDataSource);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -