Search the Community
Showing results for tags 'ShowModal'.
-
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.
-
Доброе время суток! Столкнулся с проблемой. В MainModule свойство EnableSynchronousOperations стоит True. Использую свойство EnableSynchronousOperations := True для того чтобы операция стопорилась после вызова формы через ShowModal и не продолжалась пока не была нажата кнопка Ок или Отмена. Но есть один момент, то что после нажатия на модальной форме кнопки ОК (ModalResult := mrOK), форма сразу не закрывается, а ждет пока не завершатся все операторы после ShowModal. Пример выложил ShowModalTest.zip
-
Hi everybody. I have an issue I cant resolve... How to do a continuos showmodal. I explain it. In normal scene I have this behavior. procedure TValidaVentasForm.EtiquetasButtonClick(Sender: TObject); begin while true do begin // send the form.... CodigosBarrasForm.ShowModal; // And obtain some data of that... id:=CodigosBarrasForm.CodigoEdit.Text; // if id<>'' then // we obtained valid data DoSomeVeryInterestingWithTheData(id) else break; // <---- The end of the show // or I repeat again... end; // end; I run a showmodal form to obtain a data from it until this data is an empty string.... Yes, yes, I know your answer.... Callback functions.... Here is my unigui stage: procedure TValidaVentasForm.EtiquetasButtonClick(Sender: TObject); begin CodigoBarrasform.showModal(self.FormCodigoBarrasLectura); // <---- The below procedure as callback parameter end; procedure TValidaVentasForm.FormCodigoBarrasLectura(Sender: TComponent; AResult: Integer); // <---- The callback begin // In the below variable I put the result obtained CodigoBarrasForm in mainmodule to use here... if UniMainModule.TheIDObtainedFromCodigodeBarrasForm<>'' then begin DoSomeVeryInterestingWithTheData(UniMainModule.TheIDObtainedFromCodigodeBarrasForm); // How to relaunch the form again ? end; //else // Does not happend anything // // Here is the puzzle... Please help me... how to drive this... // // // if UniMainModule.TheIdObtainedFromCodigodeBarrasForm<>'' then // begin // DoSomeVeryInterestingWithTheData(UniMainModule.TheIdObtainedFromCodigodeBarrasForm); // // But How to repeat the showmodal() ? // How to do a working: // self.EtiquetasButtonClick(Self); // end; end How to launch again the codigoBarrasForm until the CodigosBarrasform.CodigoEdit text = '' ???? Any help is welcomed.
-
1-Windows 7 Professional, Delphi XE, uniGui 0.93 Problem: Hi, I've been facing some problems trying to show forms using TUniMainMenu. Sometimes when I click the TUniMainMenu Item, they simply don't show the form. But when I edit some random line in the unit and recompile, the form shows normally. However, sometimes it doesn't work. What it would be?
-
Dear, it happens when opening a Form ShowModal and then create a MessageDlg message, I have the completed form disabled on some occasions, at what should it be? example Open form FormXXX.Showmodal; - - - MessageDlg ('? Save info?', MtConfirmation, mbYesNo, OkSave); ... completed form disabled Thanks in advance for your help mmurgas
-
Hi I need to call a form twice on the same procedure this form get some data and put it in variables and inmediately after has to do it again for other variables is there a way to do this because i've tried and it calls it on the first time but on the second nothing happens. I'm using version 0.91.0.980