Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Prism UiTypeEditorEditStyle.DropDown Beispiel gesucht. (https://www.delphipraxis.net/60138-uitypeeditoreditstyle-dropdown-beispiel-gesucht.html)

Taladan 3. Jan 2006 17:41


UiTypeEditorEditStyle.DropDown Beispiel gesucht.
 
Ich bastle eine eigene Komponente. Den modalen Designeditor nutze ich bereits für eine Eigenschaft. Doch die DropDownliste bekomme ich nicht hin. Kennt jemand das Problem? Kann jemand helfen? Hat jemand ein Beispiel (in Pascal)?

Hier mein bisheriges Ergebnis.

Delphi-Quellcode:

function AktivePageEditor.GetEditStyle(
  context: ITypeDescriptorContext): UITypeEditorEditStyle;
begin
  if (Context <> nil) and (context.Instance <> nil) then
    Result := UiTypeEditorEditStyle.DropDown
  else
    Result := UiTypeEditorEditStyle.None;
end;

function AktivePageEditor.EditValue(context: ITypeDescriptorContext;
  provider: IServiceProvider; value: TObject): TObject;
var
  Box1 : ListBox;
begin
  if (context <> nil) AND (context.Instance <> nil) and (provider <> nil) then begin
    edsvc := (IWindowsFormsEditorService(provider.GetService(TypeOf(IWindowsFormsEditorService))));
    if edsvc <> nil then begin
       Box1 := Listbox.Create;
       Box1.Items.Clear;
       Box1.Items.Add('Test');
       Box1.Items.Add('Test1');
       Box1.Items.Add('Test1');
       Box1.Height := Box1.PreferredHeight;
       if (edSvc <> nil) then begin
         edSvc.DropDownControl( Box1 );
         result := Box1.SelectedItem;
       end;
    end;

  end;
//  result := edsvc;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz