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

📄 editorgroup.pas

📁 DBDesigner 4 is a database design system that integrates database design, modelling, creation and ma
💻 PAS
字号:
//----------------------------------------------------------------------------------------------------------------------

//

// This file is part of the SimpleWebFront-DBDesigner4-Plugin.

// Copyright (C) 2003 Bayer Ulrich

//

// The SimpleWebFront-DBDesigner4-Plugin is free software; you can redistribute it and/or modify

// it under the terms of the GNU General Public License as published by

// the Free Software Foundation; either version 2 of the License, or

// (at your option) any later version.

//

// SimpleWebFront-DBDesigner4-Plugin is distributed in the hope that it will be useful,

// but WITHOUT ANY WARRANTY; without even the implied warranty of

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

// GNU General Public License for more details.



// You should have received a copy of the GNU General Public License

// along with DBDesigner4; if not, write to the Free Software

// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

//

//----------------------------------------------------------------------------------------------------------------------



unit EditorGroup;



interface



uses

  SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms, 

  QDialogs, QStdCtrls, QButtons, QExtCtrls, Weboutput;



type

  TEditorGroupForm = class(TForm)

    OKBtn: TSpeedButton;

    CancelBtn: TSpeedButton;

    GrpnameEd: TEdit;

    GrpLbl: TLabel;

    Label1: TLabel;

    LineNoEd: TEdit;

    Label2: TLabel;

    ColNoEd: TEdit;

    GroupBox1: TGroupBox;

    GroupBox2: TGroupBox;

    PopupCheckBox: TCheckBox;

    procedure FormCreate(Sender: TObject);

    procedure OKBtnClick(Sender: TObject);

    procedure CancelBtnClick(Sender: TObject);

    procedure FormKeyDown(Sender: TObject; var Key: Word;

      Shift: TShiftState);

  private

    editGrp :TGroup;



  public

    function GetGroup() :TGroup;

    procedure SetGroup(group :TGroup);

  end;



var

  EditorGroupForm: TEditorGroupForm;

implementation



uses MainDM, Main, StringConstants, Qt;



{$R *.xfm}



procedure TEditorGroupForm.FormCreate(Sender: TObject);

var strList : TSTringList;

    grpCount :Integer;

begin

  DMMain.InitForm(self); //set the correct font

  

  strList := TStringList.Create;

  MainForm.Output.GetGroupNames(strList);

  grpCount := strList.Count;

  

  strList.Free;

  LineNoEd.Text := IntToStr(grpCount+1);

  ColNoEd.Text := '1';



  editGrp := nil;

end;



function TEditorGroupForm.GetGroup() :TGroup;

var group :TGroup;

begin

  group := TGroup.Create(GrpnameEd.Text, StrToInt(LineNoEd.Text), StrToInt(ColNoEd.Text), PopupCheckBox.Checked);

  GetGroup:= group;

end;



procedure TEditorGroupForm.SetGroup(group :TGroup);

begin

  GrpnameEd.Text := group.Name;

  LineNoEd.Text := IntToStr(group.ShowOnLine);

  ColNoEd.Text := IntToStr(group.ShowInColumn);

  PopupCheckBox.Checked := group.ViewsAsPopup;



  EditGrp := group;

end;



procedure TEditorGroupForm.OKBtnClick(Sender: TObject);

var i : Integer;

    lineNo,colNo : Integer;

begin

  if (GrpnameEd.Text = '') then

  begin

    MessageDlg(NoGroupEntered, mtError,[mbOk], 0, mbOk);

    exit;

  end;



  //a groupname must not contain any chars of the following list: \ / : * ? 

⌨️ 快捷键说明

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