unit setting; //{$DEFINE DEBUG} interface uses Windows, Messages, SysUtils, Graphics, Controls, Forms, ComCtrls, ExtCtrls, StdCtrls, Grids, ActnList, Menus, Classes, ImgList, ToolWin, CheckLst, Buttons, Spin; type TApp_PuffbitsSetting = class(TForm) PageControl1: TPageControl; tabSetting: TTabSheet; grpColor: TGroupBox; chkColor_RGB: TCheckBox; chkColor_HTML: TCheckBox; chkColor_COLORREF: TCheckBox; grpPos: TGroupBox; chkPos_Screen: TCheckBox; chkPos_Client: TCheckBox; chkPos_User: TCheckBox; grpWinInfo: TGroupBox; chkWinInfo_Handle: TCheckBox; chkWinInfo_ClassName: TCheckBox; chkWinInfo_Text: TCheckBox; chkWinInfo_WindowSize: TCheckBox; chkWinInfo_ClientSize: TCheckBox; chkWinInfo_Rect: TCheckBox; chkWinInfo_ExeName: TCheckBox; grpOption: TGroupBox; chkOpt_StayOnTop: TCheckBox; chkOpt_BigFont: TCheckBox; chkOpt_NoSelfCapture: TCheckBox; chkOpt_SmoothCapture: TCheckBox; grpCapture: TGroupBox; chkCapture_Pause: TCheckBox; chkCapture_Fixed: TCheckBox; //バージョン情報 tabHelp: TTabSheet; pnlHelp_Ver: TPanel; imgHelp_Icon: TImage; lblHelp_TitleTtl: TLabel; lblHelp_Title: TLabel; lblHelp_VerTtl: TLabel; lblHelp_Ver: TLabel; lblHelp_Text: TLabel; shpHelp_Line: TShape; boxHelp_Text: TScrollBox; pnlHelp_Image: TPanel; imgHelp_Image1: TImage; imgHelp_Image2: TImage; imgHelp_Image3: TImage; imgHelp_Image0: TImage; lblHelp_Image0: TLabel; lblHelp_Image1: TLabel; lblHelp_Image2: TLabel; lblHelp_Image3: TLabel; pnlHelp_URL: TPanel; lblHelp_URL: TLabel; procedure FormCreate(Sender: TObject); procedure FormClose (Sender: TObject; var Action: TCloseAction); //ヘルプ procedure lblHelp_URLClick (Sender: TObject); procedure lblHelp_URLMouseEnter(Sender: TObject); procedure lblHelp_URLMouseLeave(Sender: TObject); private { Private 宣言 } public { Public 宣言 } end; var App_PuffbitsSetting: TApp_PuffbitsSetting; implementation uses {$IFDEF DEBUG} myDebug, {$ENDIF} general, my_monitor, main; {$R *.dfm} procedure TApp_PuffbitsSetting.FormCreate(Sender: TObject); procedure lpc_CheckBoxActionSet(CheckBox: TCheckBox; Action: TAction); begin CheckBox.Checked := Action.Checked; CheckBox.Action := Action; end; procedure lpc_CaptionTrim(Sender: TWinControl); //Captionのアクセラレータ以降を取り除く var i: Integer; l_CheckBox: TCheckBox; begin for i := 0 to Sender.ControlCount -1 do begin if (Sender.Controls[i] is TCheckBox) then begin l_CheckBox := TCheckBox(Sender.Controls[i]); l_CheckBox.Caption := StripHotKey(l_CheckBox.Caption); end; end; end; var i : Integer; lh_Menu : HMENU; lrc_Rect : TRect; begin ClientHeight := PageControl1.Height; ClientWidth := PageControl1.Width; lrc_Rect := gfnrcMonitorRectGet(gfnptMousePosGet); SetBounds(lrc_Rect.Left + (gfniRectWidth(lrc_Rect) - Width) div 2, lrc_Rect.Top + (gfniRectHeight(lrc_Rect) - Height) div 2, Width, Height); PageControl1.Align := alClient; Self.Constraints.MinWidth := Self.Width; Self.Constraints.MinHeight := Self.Height; //システムメニュー lh_Menu := GetSystemMenu(Handle, False); DeleteMenu(lh_Menu, SC_RESTORE, MF_BYCOMMAND); //元のサイズに戻す DeleteMenu(lh_Menu, SC_MINIMIZE, MF_BYCOMMAND); //最小化 DeleteMenu(lh_Menu, SC_MAXIMIZE, MF_BYCOMMAND); //最大化 DrawMenuBar(lh_Menu); //チェックボックスにアクションを設定するとチェックボックスの値が優先されてしま //ことへの対処。 with App_Puffbits do begin //カラー情報 lpc_CheckBoxActionSet(chkColor_RGB, actColor_RGB); lpc_CheckBoxActionSet(chkColor_HTML, actColor_HTML); lpc_CheckBoxActionSet(chkColor_COLORREF, actColor_COLORREF); //カーソル位置 lpc_CheckBoxActionSet(chkPos_Screen, actPos_Screen); lpc_CheckBoxActionSet(chkPos_Client, actPos_Client); lpc_CheckBoxActionSet(chkPos_User, actPos_User); //ウィンドウ情報 lpc_CheckBoxActionSet(chkWinInfo_Handle, actWinInfo_Handle); lpc_CheckBoxActionSet(chkWinInfo_ClassName, actWinInfo_ClassName); lpc_CheckBoxActionSet(chkWinInfo_Text, actWinInfo_Text); lpc_CheckBoxActionSet(chkWinInfo_WindowSize, actWinInfo_WindowSize); lpc_CheckBoxActionSet(chkWinInfo_ClientSize, actWinInfo_ClientSize); lpc_CheckBoxActionSet(chkWinInfo_Rect, actWinInfo_Rect); lpc_CheckBoxActionSet(chkWinInfo_ExeName, actWinInfo_ExeName); //オプション lpc_CheckBoxActionSet(chkOpt_StayOnTop, actOpt_StayOnTop); lpc_CheckBoxActionSet(chkOpt_BigFont, actOpt_BigFont); lpc_CheckBoxActionSet(chkOpt_NoSelfCapture, actOpt_NoSelfCapture); lpc_CheckBoxActionSet(chkOpt_SmoothCapture, actOpt_SmoothCapture); //キャプチャ lpc_CheckBoxActionSet(chkCapture_Pause, actCapture_Pause); lpc_CheckBoxActionSet(chkCapture_Fixed, actCapture_Fixed); end; lpc_CaptionTrim(grpColor); lpc_CaptionTrim(grpPos); lpc_CaptionTrim(grpWinInfo); lpc_CaptionTrim(grpOption); lpc_CaptionTrim(grpCapture); //バージョン情報 boxHelp_Text.Align := alClient; imgHelp_Icon.Picture.Assign(Application.Icon); lblHelp_Title.Caption := Application.Title; lblHelp_Ver.Caption := gfnsFileVersionGet; for i := 0 to App_Puffbits.ImageList_Icon.Count -1 do begin App_Puffbits.ImageList_Icon.GetBitmap(i, TImage(FindComponent(Format('imgHelp_Image%d', [i]))).Picture.Bitmap); end; with App_Puffbits do begin lblHelp_Image0.Caption := Format('%s/%s', [StripHotKey(actOpt_StayOnTop.Caption), actOpt_StayOnTop.Hint]); lblHelp_Image1.Caption := Format('%s/%s', [StripHotKey(actOpt_SmoothCapture.Caption), actOpt_SmoothCapture.Hint]); lblHelp_Image2.Caption := Format('%s/%s', [StripHotKey(actCapture_Pause.Caption), actCapture_Pause.Hint]); lblHelp_Image3.Caption := Format('%s/%s', [StripHotKey(actCapture_Fixed.Caption), actCapture_Fixed.Hint]); end; Tag := 1; end; procedure TApp_PuffbitsSetting.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; //バージョン情報 procedure TApp_PuffbitsSetting.lblHelp_URLClick(Sender: TObject); begin gpcExecute(lblHelp_URL.Caption); end; procedure TApp_PuffbitsSetting.lblHelp_URLMouseEnter(Sender: TObject); //アンダーラインを引く begin if not(fsUnderline in lblHelp_URL.Font.Style) then lblHelp_URL.Font.Style := lblHelp_URL.Font.Style + [fsUnderline]; Screen.Cursor := crHandPoint; end; procedure TApp_PuffbitsSetting.lblHelp_URLMouseLeave(Sender: TObject); //アンダーラインを戻す begin if (fsUnderline in lblHelp_URL.Font.Style) then lblHelp_URL.Font.Style := lblHelp_URL.Font.Style - [fsUnderline]; Screen.Cursor := crDefault; end; end.