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 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, 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 ? Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2017 Share Posted December 13, 2017 Create a new component 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 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 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 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 ? 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; } 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 ? 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 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. 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