Jump to content

New component.


Guest

Recommended Posts

Message from: "Farshad Mohajeri"

 

"ayweo" wrote in message

news:34poE2F4LHA.3560@anaxagvs227...

> Hi Farshad:

>

> you have plans to create a InputBox component?

>

 

Probably no because it can be emulated using other components.

 

 

.

 

Link to comment
Share on other sites

Message from: "ayweo"

 

If he can have a similar "UniCalendarDialog" to achieve a component like a

inputbox

 

"Farshad Mohajeri" дÈëÏûÏ¢ news:wjuX7la4LHA.2168@anaxagvs227...

 

 

"ayweo" wrote in message

news:34poE2F4LHA.3560@anaxagvs227...

> Hi Farshad:

>

> you have plans to create a InputBox component?

>

 

Probably no because it can be emulated using other components.

 

.

 

Link to comment
Share on other sites

Message from: "ayweo"

 

I have achieved a similar unit in my project.

 

unit InputBoxUnit;

 

interface

 

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics,

Controls, Forms, Dialogs, uniGUIForm, uniGUITypes, StdCtrls, =

UniButton,

UniEdit, UniLabel;

 

type

TCallBack =3D procedure (Value: string) of object;

 

TInputBox =3D class(TUniForm)

lbl1: TUniLabel;

edt_InputEdt: TUniEdit;

btn_OK: TUniButton;

btn_No: TUniButton;

procedure btn_OKClick(Sender: TObject);

procedure btn_NoClick(Sender: TObject);

private

FCallBack: TCallBack;

procedure SetCallBack(const Value: TCallBack);

{ Private declarations }

public

{ Public declarations }

property CallBack: TCallBack read FCallBack write SetCallBack;

procedure Show(Cap, Txt, Def: string; ACallBack: TCallBack);

end;

 

function InputBox: TInputBox;

 

implementation

 

{$R *.dfm}

 

uses

MainModule, uniControls;

 

function InputBox: TInputBox;

begin

Result :=3D TInputBox(UniMainModule.GetFormInstance(TInputBox));

end;

 

{ TInputBoxForm }

 

procedure TInputBox.btn_NoClick(Sender: TObject);

begin

Close;

end;

 

procedure TInputBox.btn_OKClick(Sender: TObject);

begin

if Trim(edt_InputEdt.Text) <> '' then

FCallBack(edt_InputEdt.Text);

Close;

end;

 

procedure TInputBox.Show(Cap, Txt, Def: string; ACallBack: TCallBack);

begin

Caption :=3D Cap;

lbl1.Caption :=3D Txt;

edt_InputEdt.Text :=3D Def;

CallBack :=3D ACallBack;

ShowModal;

end;

 

procedure TInputBox.SetCallBack(const Value: TCallBack);

begin

FCallBack :=3D Value;

end;

 

end.

 

"Farshad Mohajeri" =D0=B4=C8=EB=CF=FB=CF=A2 =

news:Z7Xt$Ll4LHA.2168@anaxagvs227...

Hi,Is this what you need?function InputBox(const ACaption: string; const =

APrompt: string; const ADefault: string): string;

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

OK thanks for the hint.

 

Request logged : #914

"ayweo" wrote in message =

news:boP5z$l4LHA.2168@anaxagvs227...

I have achieved a similar unit in my project.

 

unit InputBoxUnit;

 

interface

 

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics,

Controls, Forms, Dialogs, uniGUIForm, uniGUITypes, StdCtrls, =

UniButton,

UniEdit, UniLabel;

 

type

TCallBack =3D procedure (Value: string) of object;

 

TInputBox =3D class(TUniForm)

lbl1: TUniLabel;

edt_InputEdt: TUniEdit;

btn_OK: TUniButton;

btn_No: TUniButton;

procedure btn_OKClick(Sender: TObject);

procedure btn_NoClick(Sender: TObject);

private

FCallBack: TCallBack;

procedure SetCallBack(const Value: TCallBack);

{ Private declarations }

public

{ Public declarations }

property CallBack: TCallBack read FCallBack write SetCallBack;

procedure Show(Cap, Txt, Def: string; ACallBack: TCallBack);

end;

 

function InputBox: TInputBox;

 

implementation

 

{$R *.dfm}

 

uses

MainModule, uniControls;

 

function InputBox: TInputBox;

begin

Result :=3D TInputBox(UniMainModule.GetFormInstance(TInputBox));

end;

 

{ TInputBoxForm }

 

procedure TInputBox.btn_NoClick(Sender: TObject);

begin

Close;

end;

 

procedure TInputBox.btn_OKClick(Sender: TObject);

begin

if Trim(edt_InputEdt.Text) <> '' then

FCallBack(edt_InputEdt.Text);

Close;

end;

 

procedure TInputBox.Show(Cap, Txt, Def: string; ACallBack: TCallBack);

begin

Caption :=3D Cap;

lbl1.Caption :=3D Txt;

edt_InputEdt.Text :=3D Def;

CallBack :=3D ACallBack;

ShowModal;

end;

 

procedure TInputBox.SetCallBack(const Value: TCallBack);

begin

FCallBack :=3D Value;

end;

 

end.

 

"Farshad Mohajeri" =D0=B4=C8=EB=CF=FB=CF=A2 =

news:Z7Xt$Ll4LHA.2168@anaxagvs227...

Hi,Is this what you need?function InputBox(const ACaption: string; const =

APrompt: string; const ADefault: string): string;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...