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

📄 u_form_main.pas

📁 双色球分析软件
💻 PAS
字号:
unit U_Form_Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ButtonExCtl, ExtCtrls, jpeg, ComCtrls, WinSkinStore, WinSkinData;

type
  TForm_MainMenu = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Button6: TButtonExCtl;
    Button3: TButtonExCtl;
    Button1: TButtonExCtl;
    Button2: TButtonExCtl;
    Button4: TButtonExCtl;
    Image3: TImage;
    StatusBar1: TStatusBar;
    Button7: TButtonExCtl;
    procedure FormCreate(Sender: TObject);
    procedure FormPaint(Sender: TObject);
    procedure Image2Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
    procedure WMPaint(var m:TWMPaint);message WM_Paint;
  public
    { Public declarations }
  end;

var
  Form_MainMenu: TForm_MainMenu;

implementation

{$R *.dfm}
uses common,Form_RedFenXiL,Form_techAnalyseL,Form_DataInputL,U_Form_Blue;
const
  // Flags for EnumDisplaySettingsEx
  ENUM_CURRENT_SETTINGS  = $FFFFFFFF;
  ENUM_REGISTRY_SETTINGS = $FFFFFFFE;
  EDS_RAWMODE = $00000002;

type
  PDisplayMode = ^TDisplayMode;
  TDisplayMode = record
    Width: DWORD;             // 屏幕宽度(像素)
    Height: DWORD;            // 屏幕高度(像素)
    BitsPerPel: DWORD;        // 每像素位数
    Frequency: DWORD;         // 显示器频率
    Supported: Boolean;       // 显示器是否支持
    Description: string;      // 显示模式描述字串
  end;
  TDisplayModes = array of TDisplayMode;
// 获取当前显示模式
{------------------------------------------------------------------------------}
procedure GetCurrentDisplayMode(var DisplayMode: TDisplayMode);
var
  DM: DEVMODE;
begin
  EnumDisplaySettings(nil, ENUM_CURRENT_SETTINGS, DM);
  DisplayMode.Width := DM.dmPelsWidth;

  DisplayMode.Height := DM.dmPelsHeight;
  DisplayMode.BitsPerPel := DM.dmBitsPerPel;
  DisplayMode.Frequency := DM.dmDisplayFrequency;
end;

////重新画窗口的边框///////////////////
procedure TForm_MainMenu.WMPaint(var m:TWMPaint);
var
   Dc:HDC;
   OldPen:HPen;
   Pen:HPen;
   OldBrush:HBrush;
begin
   inherited;
   DC:=GetWindowDc(handle);
   Pen:=CreatePen(PS_SOLID,6,$00ad7539);
   OLdBrush:=SelectObject(dc,GetStockObject(Null_Brush));
   OldPen:=SelectObject(dc,Pen);
   Rectangle(dc,0,0,self.Width,self.Height);
   SelectObject(dc,OldPen);
   SelectObject(dc,OldBrush);
   DeleteObject(pen);
   Releasedc(handle,dc);
end;

procedure TForm_MainMenu.FormCreate(Sender: TObject);
begin
     Form_MainMenu.Top:=0;
     Form_MainMenu.Left:=0;
     Form_MainMenu.width:=Screen.Width;
     Form_MainMenu.Height:=screen.Height;
end;

procedure TForm_MainMenu.FormPaint(Sender: TObject);
var
   Bmp:TBitMap;
   CurrentPath:string;
   CurrentModes:TDisplayMode;
begin
   Bmp:=TBitMap.Create;
   currentPath:=ExtractFilePath(paramStr(0));
   //Bmp.LoadFromFile(currentPath+'\picture\caption1024.bmp');
    ////得到显示器的当前的显示模式////////
    GetCurrentDisplayMode(CurrentModes);
    //showmessage(inttostr(CurrentModes.Width));
    ////根据不同的显示模式//////////
    if CurrentModes.Width=800 then
    begin
       bmp.LoadFromFile(currentPath+'\picture\Caption800k.bmp');
       ////设置最大化按钮,最小化位置/////
       image1.Top:=6;
       image1.left:=742;
       image2.Top:=6;
       image2.Left:=767;
       button1.Top:=35;
       button2.Top:=35;
       button3.Top:=35;
       button4.Top:=35;
       button7.Top:=35;
       button6.Top:=35;

       image3.Top:=75;

       statusBar1.Top:=567;
       statusBar1.Left:=2;
       statusBar1.Width:=screen.Width-3;
       statusbar1.Height:=30;
    end;
    if CurrentModes.Width=1024 then
    begin
       bmp.LoadFromFile(currentPath+'\picture\Caption1024l1.bmp');
       ////设置最大化按钮,最小化位置/////
       image1.Top:=6;
       image1.left:=971;
       image2.Top:=6;
       image2.Left:=996;
       button1.Top:=45;
       button2.Top:=45;
       button3.Top:=45;
       button4.Top:=45;
       button7.Top:=45;

       //currentPamTop:=45;
       button6.Top:=45;

       image3.Top:=90;

       statusBar1.Top:=screen.Height-40;
       statusBar1.Left:=3;
       statusBar1.Width:=screen.Width-5;
       statusBar1.Height:=40;
    end;
    Form_MainMenu.Canvas.Draw(0,0,bmp);
    
end;

procedure TForm_MainMenu.Image2Click(Sender: TObject);
begin
    CloseForm(handle);
end;

procedure TForm_MainMenu.Button7Click(Sender: TObject);
begin
     CLoseForm(handle);
end;

procedure TForm_MainMenu.Button6Click(Sender: TObject);
begin
     if Form_DataInput=nil then
     begin
        Form_DataInput:=TForm_DataInput.Create(Application);
        Form_DataInput.Show;
     end
     else
        Form_DataInput.Show;
end;

procedure TForm_MainMenu.Button3Click(Sender: TObject);
begin
     if Form_RedFenXi=nil then
     begin
        Form_RedFenXi:=TForm_RedFenXi.Create(Application);
        Form_RedFenXi.Show;
     end
     else
        Form_RedFenXi.Show;
end;

procedure TForm_MainMenu.Button1Click(Sender: TObject);
begin
     if Form_Blue=nil then
     begin
        Form_Blue:=TForm_Blue.Create(Application);
        Form_Blue.Show;
     end
     else
        Form_Blue.Show;
end;

procedure TForm_MainMenu.Button4Click(Sender: TObject);
begin
     if Form_TechAnalyse=nil then
     begin
        Form_techAnalyse:=TForm_TechAnalyse.Create(Application);
        Form_TechAnalyse.Show;
     end
     else
        Form_TechAnalyse.Show;
end;

end.

⌨️ 快捷键说明

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