![]() |
AW: XE7: Frame soll Aktion im Hauptformular auslösen
OK, also kann es doch ein "neueres" Feature sein und es muß nix in unserem XE komisch sein. :-D
|
AW: XE7: Frame soll Aktion im Hauptformular auslösen
Hallo Sir Rufo,
Du schreibst das Du die Frames selber "dumm" lässt, aber ist es nicht gerade der Vorteil, das man möglichst viel in den jeweiligen Frames erledigt und nur das nötigste in der Hauptunit erledigt. Okay, in meinem Fall gibt es jetzt dadurch ein paar Probleme ... Gruß Heiko |
AW: XE7: Frame soll Aktion im Hauptformular auslösen
Nein ich lasse die Frames nicht dumm, aber dieser Frame war nicht der Kandidat für mehr Intelligenz.
Du möchtest mehr Intelligenz im Frame, na denn:
Delphi-Quellcode:
und der Frame:
unit Form.Main;
interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Frame.Sub; type TMainForm = class( TForm ) PageControl1: TPageControl; TabSheet1: TTabSheet; Memo1: TMemo; TabSheet2: TTabSheet; SubFrame1: TSubFrame; private protected procedure DoShow; override; public end; var MainForm: TMainForm; implementation {$R *.dfm} procedure TMainForm.DoShow; begin inherited; SubFrame1.Control := Memo1; end; end.
Delphi-Quellcode:
Ach ja, macht im Übrigen immer noch das Gleiche allerdings mit einer Spezialisierung (Frame für Controls um die Enabled Eigenschaft zu bearbeiten)
unit Frame.Sub;
interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TSubFrame = class( TFrame ) CheckBox1: TCheckBox; procedure CheckBox1Click( Sender: TObject ); private FControl: TControl; procedure SetControl( const Value: TControl ); protected procedure Notification( AComponent: TComponent; Operation: TOperation ); override; public property Control: TControl read FControl write SetControl; end; implementation {$R *.dfm} { TSubFrame } procedure TSubFrame.CheckBox1Click( Sender: TObject ); begin FControl.Enabled := CheckBox1.Checked; end; procedure TSubFrame.Notification( AComponent: TComponent; Operation: TOperation ); begin inherited; if ( Operation = opRemove ) and ( AComponent = FControl ) then SetControl( nil ); end; procedure TSubFrame.SetControl( const Value: TControl ); begin if Assigned( FControl ) then FControl.RemoveFreeNotification( Self ); FControl := Value; if Assigned( FControl ) then begin FControl.FreeNotification( Self ); CheckBox1.Checked := FControl.Enabled; end; CheckBox1.Enabled := Assigned( FControl ); end; end. |
AW: XE7: Frame soll Aktion im Hauptformular auslösen
Hallo Sir Rufo,
Also auf diesem Weg habei ch jetzt auch hin bekommen. Zitat:
Gruß Heiko |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:59 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz