Jump to content

UniMainMenu (width)


Sherzod

Recommended Posts

 
Hi ,
 
I believe that the problem is not having the ability to access the properties of the jsname of UniMainMenu and UniMenuItem.
 
Only for demonstration purposes, I have tried the following code:
 
 
 

in my example >>    O3B is the Jsname of UniMainMenu 

 
procedure TMainForm.UniFormCreate(Sender: TObject);
begin

 

 
unisession.addjs(
 'O3B.nm="O3B";_cdo_("O3B",O3B,null,MainForm);' +
                  '_coe_(MainForm,"O3B",null,"beforerender",function(sender) {sender.height = 60;});') ;

 

end;
 
this works

 

Regards, 

 

Salvatore Marullo

Link to comment
Share on other sites

hi Delphi Developer,

 

 simple, from js code generated by unigui

 

in this  example     O32 is  UniMainMenu  

 

                            O3A and O3F are  UniMenuItem 

 

O32=new Ext.toolbar.Toolbar({id:"O32_id",height:26,items:[O3A,O3F]});

O3F=new Ext.button.Button({id:"O3F_id",text:"Test1"});

O3A=new Ext.button.Button({id:"O3A_id",text:"Test2"});

 

As I said this is only applicable for demonstration test, definitely not for production.

 

1) Start your program,  looks for  Jsname of UniMainMenu  in Js generate code 

2) change your code and add

 

 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin

 

 
unisession.addjs(
 'O32.nm="O32";_cdo_("O32",O32,null,MainForm);' +
                  '_coe_(MainForm,"O32",null,"beforerender",function(sender) {sender.height = 60;});') ;

 

end;

 

3) Compile and Run : It work !!!

 

 

 

 

 

2 . Solution   ( not  tested 100% ) 

 

Add 

 

  Type 

   TZMainMenu = class(TuniMainMenu) ;
 

 

 .....

 

 

........

 

Var JsnameMainMenu : string ;

 
   JsnameMainMenu :=   TZMainMenu(unimainmenu1).GetMenuControl.JSName ;
 

 

 

// unimainmenu1 is the name of TuniMainMenu component. 

 

=============================================================================

P.S.  honestly do not know how complicated is for Mr. Farshad to  add  the Property

        JSName for UniMainMenu and UniMenuItem , definitely the best solution. 

 

 

 

Regards.

 

Salvatore Marullo

  • Upvote 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...