Comments (26)
https://wiki.freepascal.org/ATTabs#How_to_use_it_like_TPageControl
from atflatcontrols.
Hi. I saw that but I don't understand how to do it.
Do you not have a sample with the Frames in already? I don't know how to use frames.
from atflatcontrols.
Use Forms instead of Frames. like this
var F: TForm;
begin
F:= TForm.CreateNew;
F.Parent:= MainForm;
F.Align:= alClient;
F.BorderStyle:= bsNone;
F.Show;
from atflatcontrols.
How do I show the content of the form I build at design time as the tab if I creat a blank form like in your sample? And If I use more than one form as tabs how do I send data between the tabs like with a TPageContol item. With PageControl everything is in one form and I can get to each item on every tab.
from atflatcontrols.
you cannot design ui on Tabs in design time. you have to design all forms as separate forms, then in RUNTIME you embed them into one host panel.
from atflatcontrols.
I like your controls but I am a beginner and I don't know what you are talking about. If you had a sample with Frames or Forms that work like PageControl I would understand what you are saying.
from atflatcontrols.
I made new demo
https://github.com/Alexey-T/ATFlatControls/tree/master/app/demo_tabs_as_pagecontrol
OK?
from atflatcontrols.
It is for Lazarus, but you can see source code for Delphi
from atflatcontrols.
Thank you very much. I am using Lazarus on the Raspberry Pi. The sample won't run. It is complaining that it can not find Interfaces in the uses clause. all your other sample work.
from atflatcontrols.
OK I got it working on windows. But the app seems very slow. why would that be.
If I type text into the text box the text will lag way behind. Anyway thanks for the sample.
from atflatcontrols.
OK how do you interface between the forms?
With PageControl all items are in one form and I can get to all items with code.
Lets say there is a text item on tab3 and a button on tab1. If I click on Button on tab1 then the textbox on tab3 but show "Hello World". If I use a PageControl I do it like this.
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Edit1.Caption := 'Hello World";
end;
How do I do that if you have separate forms?
from atflatcontrols.
Thank you very much. I am using Lazarus on the Raspberry Pi. The sample won't run. It is complaining that it can not find Interfaces in the uses clause. all your other sample work.
I cannot see this error here in Lazarus 2.1 trunk. linux. project uses LCL package so its ok.
from atflatcontrols.
- I dont see that it's slow- all ok here on Linux
- you can write Form_Frame1.Button1.Caption:= '...' or Form_Frame3.Edit1.Text:= '..'
from atflatcontrols.
This is on the Raspberry Pi. Also using 2.1.0
from atflatcontrols.
OK I got it working on the Pi
from atflatcontrols.
Thank you Alexey. You have shown me a lot about how to use your controls and how to use Forms in Lazarus. I just neet to understand this last part then I will go off and do my own thing. I updated your sample to have a button on Tab1 / Frm1 . Button1 and a Textbox on Tab2 / Frm2. I want to update the text in the textbox on Tab2 if I click on the Button on Tab1. Where do I put the code and how should I address it?
Here is the button on Tab1 called Button1
Here is the text box called Edit1 on Frm2
I also want to know if I can update items on the Forms from the main Form. Lets say data is comming into the Main Form via a Rest call. The main form will have a callback that will be called if there is data. Then I want to send that data to one of the Tabs / Forms. So for a test I will just add a timer to the main form like this . every second I want to update a text box on Tab3 from the timer event on the main form.
Is what I ask possible ?
from atflatcontrols.
Also, Can I call code in the main form from the 3 other forms? Let's say the main form creates a database connection and has some procedures to update the database. Can I call the code to update the database from the 3 forms/tabs?
from atflatcontrols.
seems, IDE has new format of LPI file so my LPI file is read on your PC without LCL package.
my file has
<RequiredPackages>
<Item>
<PackageName Value="atflatcontrols_package"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
from atflatcontrols.
If I try to update the textbox on Form 3 in the timer I get errors. I don't know how to reference the item
from atflatcontrols.
- you cannot call code in mainform from child forms
- your code "f3.Edit1.Caption:= ..." is ok, so maybe you miss smth, e.g. "Edit1" is missed on f3? use only those names which defined in f3.
from atflatcontrols.
Mmm OK that is a problem then. Do I have to make a new connection on the child form then if I can not call code on Parent Form.
Here is Form 3
If I try to update its text I get this error. It does not see the text box.
from atflatcontrols.
Reason is type of variable f3. Change it to actual type
from atflatcontrols.
Access to main form- ask it at the Lazarus forum
from atflatcontrols.
OK I can update the main form from the child form. I write some code now and it works. I now still need to know how to access the child form from the main form. What do you mean by "Change it to actual type" ?
from atflatcontrols.
OK I got it working. Thanks a lot. Now I know how to do it all.
from atflatcontrols.
F3 has actual type TFormFrame3 or the like
from atflatcontrols.
Related Issues (20)
- Drag/drop from other controls not working HOT 7
- Font scaling correction HOT 8
- Question about buttons placed on the left side and tabwidth of the leftmost tab after scrolling HOT 4
- Can't compile ATCanvasPrimitives in 10.4 HOT 4
- How put a form insde tTab or controls like tpage HOT 3
- Prob with DragDrop (unexpected exchange of tabs)? HOT 14
- TATTabs: Missing Event while reordering Tabs HOT 7
- Little problem again HOT 4
- Small problem
- Little problem in Delphi
- How to change the position of dropdown list of a ATComboEdit? HOT 6
- Bug report in TabChangeQuery HOT 3
- Case where changed Data.TabHint is not reliably propagated to tab's hint HOT 9
- Problem HOT 2
- Delphi 11 + TAntialiasingMode HOT 8
- ATStatusBar.pas - Delphi 10.2 HOT 1
- Option for right click HOT 2
- OptMouseDragOutEnabled broken? HOT 3
- Drag marker shown after context menu HOT 21
- Drag marker shown at left click on active tab HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atflatcontrols.