Search the Community
Showing results for tags 'getforminstance'.
-
I am getting further in having my app actually do something useful. I have 5 questions that are probably simple to answer, but since I'm a NEWBIE, I don't know the answers to them. QUESTION #1: I see two ways to create forms... 1. MyForm := TUniForm5.Create(UniApplication) 2. Result := TFormAnchor(UniMainModule.GetFormInstance(TFormAnchor)); Since method #2 is more commonly used everywhere, why do #1? Which is better? I also noticed that a bunch of forms have this sort of thing at the end... initialization RegisterClass(TUniMaskEdit); I presume this is so that the... FrC := TUniFrameClass(FindClass(FClassName)); line of code will find the class and be able to instantiate it onto a Tab in the page control, when the user clicks on the TreeView node? QUESTION #2: I noticed that you mentioned that the SHOW/SHOWMODAL should be in the same procedure that creates the form object, in an earlier post. Why should it be shown in the same event that creates the form object? QUESTION #3: What makes a form a "FreeForm" ? The forum said in an earlier post... Free form should be created in code manually. It is not managed by framework. What does that mean? QUESTION #4: Why is there a unitTimer? is TTimer not any good? QUESTION #5: From an earlie post, I saw... For example several times I've seen that developers do things like below: procedure TMainForm.UniEdit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = 13 then begin // do somthing end; end; Which doesn't make sense at all when you deploy your app on the web. It would make sense only in a gigabit LAN, but certainly makes no sense on the internet. I do this EXACT thing when the user presses the ESC key so I can exit the form. Why is that a bad idea? How else would I close the form when the user presses the ESC key?