tappatappa Posted September 30, 2015 Share Posted September 30, 2015 In MegaDemo procedure TMainForm.ThemeClick(Sender: TObject); begin if UniApplication<>nil then begin UniServerModule.Lock; try case TComponent(Sender).Tag of 1 : UniServerModule.CurrentTheme:='blue'; 2 : UniServerModule.CurrentTheme:='gray'; 3 : UniServerModule.CurrentTheme:='classic'; 4 : UniServerModule.CurrentTheme:='xp'; 5 : UniServerModule.CurrentTheme:='vista'; end; finally UniServerModule.UnLock; end; TUniGUIApplication(UniApplication).Restart; end; end; Is it possible to implement a similar feature without changing UniServerModule and restarting the Application? Link to comment Share on other sites More sharing options...
ZigZig Posted September 30, 2015 Share Posted September 30, 2015 Hi, You can use swapStyleSheet function. Try something like this (used to work in old versions of uniGUI, not tested in newer versions) : UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/ext-4.2.1.883/resources/css/ext-all-gray.css'',''/ext-4.2.1.883/resources/css/ext-all.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/ext-4.2.1.883/resources/ext-theme-gray/ext-theme-gray-all.css'',''/ext-4.2.1.883/resources/ext-theme-classic/ext-theme-classic-all.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/uni-0.94.0.1024/css/uni-xtheme-gray.css'',''/uni-0.94.0.1024/css/uni-xtheme-blue.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/myApplication.dll/ext-4.2.1.883/resources/css/ext-all-gray.css'',''/myApplication.dll/ext-4.2.1.883/resources/css/ext-all.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/myApplication.dll/ext-4.2.1.883/resources/ext-theme-gray/ext-theme-gray-all.css'',''/myApplication.dll/ext-4.2.1.883/resources/ext-theme-classic/ext-theme-classic-all.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/myApplication.dll/ext-4.2.1.883/uni-0.94.0.1024/css/uni-xtheme-gray.css'',''/myApplication.dll/ext-4.2.1.883/uni-0.94.0.1024/css/uni-xtheme-blue.css'');'); UniSession.AddJS('Ext.util.CSS.swapStyleSheet(''/myApplication.dll/uni-0.94.0.1024/css/uni-xtheme-gray.css'',''/myApplication.dll/uni-0.94.0.1024/css/uni-xtheme-blue.css'');'); You'll need to adapt the code with newest ExtJS Path, uniGUI Path, dll name and the name of the theme you want to use. Link to comment Share on other sites More sharing options...
ZigZig Posted October 2, 2015 Share Posted October 2, 2015 Hi Nefasto Cipa, Was it helpful? Does this trick still work? Link to comment Share on other sites More sharing options...
tappatappa Posted October 2, 2015 Author Share Posted October 2, 2015 Hello ZigZig, I am trying. Is not remotely as easy as I hoped Moreover, I guess I have to make it more flexible by retrieving the uniGUI/extjs version from ServerModule. How do I have to change the path in Stand Alone Server mode (I see you refer to the dll in the paths)? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now