Jump to content

Recommended Posts

Posted

 

Hi All! 
 
Does anyone know, how to set the width at the UniMainMenu, (with word-wrap...)?
 
Sincerely...

 

 

more precisely width UniMenuItem

Posted
 
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

Posted

 

in my example >>    O3B is the Jsname of UniMainMenu 

 

 

Hi rullomare!
 
Thank you for your response.
 
How did you know that "O3B", this is UniMainMenu?
 
Thank you ...
Posted

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
Posted

 

Hi All! 
 
Does anyone know, how to set the width at the UniMainMenu, (with word-wrap...)?
 
Sincerely...

 

 

I think, to set the width UniMenuItem, easier to use caption with "<br>"
 
Sincerely ...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...