Forum > Packages and Libraries

tvpCllock on a Frame - does not want to appear on its parent

(1/2) > >>

Nicole:
I use tvpcCock and made myself a nice watch.
It runs fine as small stand alone program.

Now I wanted it to add it the source to a different program onto a Tabscheet of a PageControl.
I took the source and renamed all "Form"s to "Frame"s.
The IDE showed me on F 12 what I wanted to see.

Now I wanted to add the Frame to my parent, - but there just does not happen anything.
What may be wrong?



--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   if Frame_Zeitgeber = nil then   begin      Frame_Zeitgeber := TFrame_Zeitgeber.Create(self);  // Kalender wird aus einem Frame geholt      Frame_Zeitgeber.Parent := TabSheet_Zeitgeber;  // Frame kommt ins PageControl      Frame_Zeitgeber.Align := alClient;      Frame_Zeitgeber.FormShow(self); // => I tried it with and without this line    end;

af0815:
Do you know what you are doing ?  Have you also renamed in the lfm correct?

Better is normal to take a new Frame and copy your layout with the designer. And a frame have never a FormShow. You can only show the parent.

Nicole:
Yes, I renamed everything including the lfm.
The show line, I just tried, because it did not work.

To copy the design would destroy all my methods.
I have rather a bundle of them.

wp:
I don't understand...

You have a form with a VpClock, and you want to convert the form to a frame? Ideally, you should create a Frame as a TFrame by using the IDE template "File" > "New" > "Frame". But if you already have everything on a form, you are excused to "cheat".

* Close the IDE
* Open the lfm file of the form which you want to convert to a frame into an editor (Notepad++ is excellent); I assume that the form was a type TForm1.
* In the first line after the color, change the "Form1:TForm1" to "Frame1:TFrame1".
* Scroll down and inspect the form properties. Delete all properties which do not exist in a TFrame. Caption very certainly is one of them. Maybe there is also DesigntimePPI. Delete these lines. Save.
* Now load the pas file belonging the lfm file that you modified
* Replace the declaration "Form1:TForm1" by "Frame1:TFrame" (or whatever you named it). Delete the global var declaration (var Form1: TForm1). Save.
* If the form was autocreated is has a line in the lpr file ("Application.CreateForm(Form1, TForm1)"), delete this line - there is no "Form1" any more (you had renamed it to "Frame1").That's all (except for that what I forgot...).

Start Lazarus and insert the new frame into the form where it should be. In my test the frame did not appear at runtime, like in your case. I played around a bit, and suddenly it was working. Maybe because I had resized the frame in the frame unit a little bit.

Nicole:
I tried it all, unfortunately it did not appear.

PS: I tried a lot, e.g. to intervene by a var, which was my old Delphi style. Nothing worked.

PPS:
Frustrated I copied the Frame's base panel to the PageControl's Tabsheet instead.
Worked, but all my methods are broken and want to be re-added by hand.

Navigation

[0] Message Index

[#] Next page

Go to full version