irigsoft Posted December 13, 2017 Share Posted December 13, 2017 Hi, I must create customCSS with static coloring rules. I read some examples on forum, but: 1. All use addcls on delphi code, I dont want that 2. How can use uniControl Delphi name, like UniButtomMyColoringButton, uniPanel_MyColorPanel UniGui Edition: Profesional v1421 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 Hi, In this case it is better to use the inheritance I think Best regards, Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2017 Author Share Posted December 13, 2017 Inheritance of what, can I use direct control names in css ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 Create a new component Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 can I use direct control names in css ? Yes Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2017 Author Share Posted December 13, 2017 Tanks, I try this : 1. Create dinamically forms and components 2. In Customcss use name .TBitBtn1 {border-radius:10px; background-color: rgb(211,235,225) !important; border: 1px solid rgb(142,28,36); } and no change applied May be I wrong with addressing by name Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 Hi, One possible solution, for example: http://forums.unigui.com/index.php?/topic/9446-how-to-change-tunicalendarpanel-day-cell-background-color/&do=findComment&comment=48981 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2017 Author Share Posted December 13, 2017 I want to use Delphi name, my button's name is uniBtnClose Just put this on customcss and no efect. ".uniBtnClose {border-radius:5px; background-color: #fefbd8; color: #fefbd2; border: 1px solid rgb(142,28,36); }" but if use on form.create: "uniBtnClose.JSInterface.JSCall('addCls', [uniBtnClose.Name]);" it work My question is: how to use Delphi name "uniBtnClose" in customcss ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 If I understand correctly you, you can try to use this approach: For example for UniButton1: 1. UniButton1 -> ClientEvents -> ExtEvents -> function afterrender: function afterrender(sender, eOpts) { var me=sender; me.el.dom.setAttribute('name', me.uname); } 2. CustomCSS: a[name="UniButton1"] .x-btn-inner { font-size: 12px; color: green; font-weight: bold; } Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2017 Author Share Posted December 13, 2017 Pardon my "English". with javascript events I succeeded. but the question is, can customCSS use Delphi names ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 but the question is, can customCSS use Delphi names ? Sorry, maybe I misunderstand you, Yes, as a solution above, But you need to follow certain rules: https://www.w3schools.com/cssref/css_selectors.asp Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2017 Author Share Posted December 13, 2017 thanks I spent a few hours browsing, but it is better to drink than the spring. 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.