Abaksoft Posted July 12, 2015 Share 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 Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 12, 2015 Administrators Share 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 Link to comment Share on other sites More sharing options...
Abaksoft Posted July 12, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 12, 2015 Administrators Share Posted July 12, 2015 All of the unigui components are thread safe by default. What is your main concern here? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted July 12, 2015 Author Share Posted July 12, 2015 Ok, i will send you an exemple tomorrow ان شاء الله. Thank you Farshad. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted July 13, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
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.