AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

bds2006 Menu Designer Limit

Ein Thema von cramer · begonnen am 10. Apr 2017 · letzter Beitrag vom 12. Apr 2017
 
Benutzerbild von cramer
cramer

Registriert seit: 23. Jun 2004
Ort: Velbert (NRW)
108 Beiträge
 
Delphi 2006 Enterprise
 
#7

AW: bds2006 Menu Designer Limit

  Alt 11. Apr 2017, 16:11
Auf Grund von Zeitmangel bin ich jetzt bei diesem Workaround gelandet.

Delphi-Quellcode:
function MenuAddMainItem( aForm : tForm; aPopUpMenu : TPopUpMenu; aEnabled, aVisible : integer; aCaption, aHint : string; aImageIndex : integer; aOnClickEvent : TNotifyEvent; aAction : TAction; aShortCut : string ) : TMenuItem;
var xMI : TMenuItem;
begin
   with aPopUpMenu do begin
      xMI := TMenuItem.Create( aForm );
      Result := xMI;
      with xMI do begin
         enabled := aEnabled = 1;
         visible := aVisible = 1;
         caption := aCaption;
         hint := aHint;
         imageIndex := aImageIndex;
         onClick := aOnClickEvent;
         shortCut := TextToShortCut( aShortCut );
         action := aAction;
      end;
      Items.Add( xMI );
   end;
end;

function MenuAddSubItem ( aForm : tForm; aItemParent : TMenuItem; aEnabled, aVisible : integer; aCaption, aHint : string; aImageIndex : integer; aOnClickEvent : TNotifyEvent; aAction : TAction; aShortcut : string ) : TMenuItem;
var xMI : TMenuItem;
begin
   xMI := TMenuItem.Create( aForm );
   Result := xMI;
   with xMI do begin
      enabled := aEnabled = 1;
      visible := aVisible = 1;
      caption := aCaption;
      hint := aHint;
      imageIndex := aImageIndex;
      onClick := aOnClickEvent;
      shortCut := TextToShortCut( aShortCut );
      action := aAction;
   end;
   aItemParent.Add( xMI );
end;

procedure TMV.FormCreate( Sender : TObject );
var
   // Max Tiefe 5 Menu Ebenen
   xMi1, xMi2, xMi3, xMi4, xMi5 : TMenuItem;
begin
   // 2017.04.11.uc - Workaround PopUpMenu verliert Einträge
   // (pop3 ist im form definiert und zugeordnet)
   xMi1 := MenuAddMainItem( self, Pop3, 1, 1, 'Intern'         , '-'       , 22 , nil , nil, '' );
   xMi2 := MenuAddSubItem ( self, xMi1, 1, 1, 'Adressanschrift', 'Adresse' , 98 , A_Vari, nil, '' );
   xMi2 := MenuAddSubItem ( self, xMi1, 1, 1, 'Adresszeile'    , 'Zeile'   , -1 , A_Vari, nil, '' );
   xMi2 := MenuAddSubItem ( self, xMi1, 1, 1, 'Brief'          , 'Brief'   , -1 , A_Vari, nil, '' );
   xMi2 := MenuAddSubItem ( self, xMi1, 1, 1, 'Adresse'        , ''        , -1 , nil , nil, '' );
   xMi3 := MenuAddSubItem ( self, xMi2, 1, 1, 'Anrede'         , 'Anrede'  , -1 , A_Vari, nil, '' );
   xMi3 := MenuAddSubItem ( self, xMi2, 1, 1, 'Vorname'        , 'VorName' , -1 , A_Vari, nil, '' );
   xMi3 := MenuAddSubItem ( self, xMi2, 1, 1, 'Name/Firma'     , 'NachName', -1 , A_Vari, nil, '' );
   xMi2 := MenuAddSubItem ( self, xMi1, 1, 1, '-'              , ''        , -1 , nil , nil, '' );
end;
Erfahrung ist etwas, daß man erst bekommt, kurz nachdem man es dringend gebraucht hätte.
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:45 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