Abaksoft Posted July 12, 2015 Posted July 12, 2015 Hi Farshad, Is it true, otherwise can i add a form instance like this : function UniFrame1: TUniFrame1; >>> GetFormInstance As : unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIFrame; type TUniFrame1 = class(TUniFrame) private { Private declarations } public { Public declarations } end; function UniFrame1: TUniFrame1; implementation {$R *.dfm} uses MainModule, uniGUIApplication; function UniFrame1: TUniFrame1; begin Result := TUniFrame1(UniMainModule.GetFormInstance(TUniFrame1)); end; end. thx... Quote
Administrators Farshad Mohajeri Posted July 12, 2015 Administrators Posted July 12, 2015 This code is not safe. Unlike forms, each frame needs to have a parent. You can not use frames this way. Quote
Abaksoft Posted July 12, 2015 Author Posted July 12, 2015 So, if i understand a simple Frame on a Main form parent (wich is thread safe) is just enough. This frame will be thread safe ? Is it true ? Thx... Quote
Administrators Farshad Mohajeri Posted July 12, 2015 Administrators Posted July 12, 2015 All of the unigui components are thread safe by default. What is your main concern here? Quote
Abaksoft Posted July 12, 2015 Author Posted July 12, 2015 Ok, i will send you an exemple tomorrow ان شاء الله. Thank you Farshad. Quote
Abaksoft Posted July 13, 2015 Author Posted July 13, 2015 Hi Farshad, Here is a classical exemple (like AllFeatures Unigui DEMO): One TreeView on the MainForm, where onClick event gives Frames (parent = mainForm). My question is : By the simple fact that all these Frames have mainForm as Parent, the code inside these Frames will be Thread Safe (without global variable ofcourse) ? Thank you again... Frames.zip Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.