Search the Community
Showing results for tags 'Show'.
-
procedure TMainForm.UniFormCreate(Sender: TObject); ... ////////////////////////////////////////////////////////////////////////////// grdSuppliers.ClientEvents.ExtEvents.Clear; MyScript:= 'hide=function hide(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Hiding_'', []); '+ '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); // MyScript:= 'show=function show(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Showing_'', []); '+ '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); ... // ONLY EVENTS FIRED data/load/columnresize procedure grdSuppliersAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); ... ////////////////////////////////////////////////////////////////////////////// if SameText('_Hiding_', EventName) then begin // NEVER FIRES ////////////////////////////////////////////////////////////////////////////// if SameText('_Showing_', EventName) then begin // NEVER FIRES Please advise - Thanks in advance
-
Hi all, is it possible to call methods (or read/set properties values) contained in a form, without showing the form itself? For example: in my project there are 2 forms: Main and Unit1. Unit Main: //AllFeatures: Forms,Callback,icon-form-fieldui unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIRegClasses, uniguiclasses, uniGUIForm, uniMemo, uniGUIBaseClasses, uniButton; type TMainForm = class(TUniForm) UniMemo1: TUniMemo; btnTest1: TUniButton; bntTest2: TUniButton; procedure btnTest1Click(Sender: TObject); procedure bntTest2Click(Sender: TObject); private { Private declarations } public { Public declarations } procedure ShowCallBack(Sender: TComponent; AResult:Integer); end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication, Unit1; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; procedure TMainForm.bntTest2Click(Sender: TObject); begin //I'd like to call the function "UniForm1.Test" without UniForm1 shows UniMemo1.Lines.Add(UniForm1.Test); end; procedure TMainForm.btnTest1Click(Sender: TObject); begin //I'd like to set the "UniForm1.pMessage" value without UniForm1 shows UniForm1.pMessage:='TEST!'; end; initialization RegisterMainFormClass(TMainForm); end. Unit1: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIForm, uniGUIBaseClasses, uniButton, uniLabel; type TUniForm1 = class(TUniForm) UniButton1: TUniButton; UniButton2: TUniButton; UniLabel1: TUniLabel; private { Private declarations } public { Public declarations } pMessage: string; function Test: string; end; function UniForm1: TUniForm1; implementation {$R *.dfm} uses MainModule, uniGUIApplication; function UniForm1: TUniForm1; begin Result := TUniForm1(UniMainModule.GetFormInstance(TUniForm1)); end; function TUniForm1.Test: string; begin Result:='Hello world'; end; end. Is there any chance to execute btnTest1Click or btnTest2Click without the form Unit1 is displayed? Thanks in advance.
-
Hi Farshad, I know it's a "stupid" question, but why is it mandatory to display Form after creating it in UniGui? Is not there really a way around this? I understand that I'm messing with the View layer of the application, and it does not make much sense to tinker with the View and not display it. But sometimes we want to just get a name from a Form component, or a component property, or even run some component event on the Form.