benoitclaeys Posted January 25, 2021 Share Posted January 25, 2021 hi, I try to create at runtime UnimBitBtn with 64x64 icons. A ) I defined in customSS that : .custom64Glyph .x-icon-el { width: 64px !important; height: 64px !important; } B ) UnimBitBtn created at design time with Layout.cls=custom64glyph work perfectly C) Same created at run time do not work.... you can see all my tests in code. see comented line // 'test here' in code. UniSession.AddJS('Ext.suspendLayouts()'); // on suspend la mise en place de layout for i := 0 to UniMainModule.SbModuleInfoList.Count-1 do begin AModuleInfo:=UniMainModule.SbModuleInfoList.GetModuleInfoByIndex(i) ; if (AModuleInfo.GroupName=GroupId)or(GroupId='*') then begin AmBitBtn:=TUniMBitBtn.Create(Self) ; AmBitBtn.Name:='UnimBitBtn'+AModuleInfo.FModuleId ; // here I try to apply the cls ..... // test here : AmBitBtn.JSInterface.JSConfig('cls', ['custom64Glyh']); // test here : AmBitBtn.JSInterface.JSCall('addCls', ['custom64Glyh']); // test here : UniSession.AddJS(AmBitBtn.JSName + '.addCls(''custom64Glyh'');'); // test here : AmBitBtn.JSInterface.JSCall('addCls', ['custom64Glyh']); // test here : Access_LayoutConfig(AmBitBtn.LayoutConfig).Cls:= 'custom64Glyh'; AmBitBtn.width:=120 ; AmBitBtn.Height:=120 ; AmBitBtn.Images:=UniImageListModule ; AmBitBtn.Imageindex:=AModuleInfo.FIconIdx ; AmBitBtn.iconAlign:=iaTop ; AmBitBtn.HelpKeyword:=AModuleInfo.FModuleId ; AmBitBtn.Tag:=AModuleInfo.FModuleTag ; AmBitBtn.font.Size:=12 ; AmBitBtn.Caption:=AModuleInfo.FContextName ; AmBitBtn.Onclick:=UnimBitBtnModuleClick ; AmBitBtn.Parent:=AParent ; end; end; UniSession.AddJS('Ext.resumeLayouts(true)'); // test here aParent.JSInterface.JSCall('updateLayout', []); please Help Regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2021 Share Posted January 26, 2021 17 hours ago, benoitclaeys said: custom64Glyh Hi, Correct: custom64Glyph ? Quote Link to comment Share on other sites More sharing options...
benoitclaeys Posted January 26, 2021 Author Share Posted January 26, 2021 Hi, this is what I defined in the CustomCSS >>> I use the solution explained by you in this topic 13267 : "Problem Tunimbtbutton with glyph image" This solution works fine if BitBtn is designed in Delphi. See property setting "LayoutConfig.Cls=custom64Glyph" But I don't know how to set the Layoutconfig.cls when I create the BitBtn at runtime. You can see all my tries (5) in all the commented lines "// test here" to do that. but without sucess. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2021 Share Posted January 26, 2021 18 hours ago, benoitclaeys said: AmBitBtn.JSInterface.JSConfig('cls', ['custom64Glyh']); Incorrectly assigned the class name... Should be: AmBitBtn.JSInterface.JSConfig('cls', ['custom64Glyph']); Quote Link to comment Share on other sites More sharing options...
benoitclaeys Posted January 26, 2021 Author Share Posted January 26, 2021 😮 thanks à lot !!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.