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

📄 home_main.pas

📁 一个简单的家庭财务管理软件。
💻 PAS
字号:
unit home_main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus,input_lsz,config,ccb,count, jpeg, ExtCtrls, StdCtrls,
  ComCtrls,childccp,query;
 {
const

  TwinClass: array[0..3] of TChildccClass = (TTotal,TSys_Config,TCcqk,Tinput);
     }

type
  TMainForm = class(TForm)
    MainMenu: TMainMenu;
    file1: TMenuItem;
    tool1: TMenuItem;
    new: TMenuItem;
    config: TMenuItem;
    help1: TMenuItem;
    about: TMenuItem;
    exit: TMenuItem;
    query1: TMenuItem;
    countT1: TMenuItem;
    PC1: TPageControl;
    Panel1: TPanel;
    stu: TMenuItem;
    procedure newClick(Sender: TObject);
    procedure configClick(Sender: TObject);
    procedure exitClick(Sender: TObject);
    procedure query1Click(Sender: TObject);
    procedure countT1Click(Sender: TObject);
    procedure PC1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
     procedure CloseCurrentWindow;
     procedure openchild(value :TChildccClass;s_atom: Pchar);
    procedure stuClick(Sender: TObject);

  private
    sys_config:Tsys_config ;
    ccqk :Tccqk;
    input :Tinput;
    total :TTotal;
    study :Tstudy;
    { Private declarations }
  public
  
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

procedure TMainForm.openchild(value :TChildccClass; s_atom: Pchar);
var
  www:TChildcc;
  newpage:TTabsheet;
begin
    if GlobalFindAtom(s_atom) = 0 then
        begin
          if pc1.Visible =false then   pc1.Visible := true;
           newpage := TTabsheet.Create(self);
           newpage.PageControl := pc1;
           pc1.ActivePageIndex := pc1.PageCount - 1;
           www := value.create(owner,newpage);
           newpage.Caption := www.Caption ;
         end;
end;

procedure TMainForm.newClick(Sender: TObject);
begin
      openchild(Tinput,'input');
end;

procedure TMainForm.configClick(Sender: TObject);
begin
      openchild(Tsys_config,'config');
end;

procedure TMainForm.exitClick(Sender: TObject);
begin
      application.Terminate;
end;

procedure TMainForm.query1Click(Sender: TObject);
begin
      openchild(Tccqk,'ccqk');
end;


procedure TMainForm.countT1Click(Sender: TObject);
begin
      openchild(Ttotal,'total');
end;


function CaseString (const s: string;
                       const x: array of string): Integer; 
  var i: Integer; 
  begin
      Result:= -1;
      for i:= Low (x) to High (x) do
      begin
        if s = x[i] then begin  Result:= i;  Exit;  end;
      end;
  end;

procedure TMainForm.CloseCurrentWindow;
begin
  case CaseString (pc1.ActivePage.Caption,[sys_config.caption,
  total.caption,input.caption,ccqk.caption,study.caption]) of
    0: sys_config.close;
    1: Total.Close;
    2: input.Close;
    3: ccqk.Close;
    4: study.Close;
  end;
  pc1.ActivePage.Free;
  if pc1.PageCount < 1 then
     pc1.Visible := false;

end;

PRocedure TMainForm.PC1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
    if ssdouble in shift then
      CloseCurrentWindow;

end;


procedure TMainForm.stuClick(Sender: TObject);
begin
    openchild(TStudy,'study');
end;

end.

⌨️ 快捷键说明

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