soledue Posted April 4, 2012 Posted April 4, 2012 I would like to color one button. how can I assign a css class to the button, or give it an id? 1 Quote
Administrators Farshad Mohajeri Posted April 4, 2012 Administrators Posted April 4, 2012 Buttons are drawn using CSS theme. You need to play with CSS theme, but this will affect all buttons. Quote
soledue Posted April 4, 2012 Author Posted April 4, 2012 I found it Button.ExtControl.Id := 'my_id'; Buttons are drawn using CSS theme. You need to play with CSS theme, but this will affect all buttons. Quote
Mediv Posted April 4, 2012 Posted April 4, 2012 Put this into servermodule customcss .button { display: inline-block; outline: none; cursor: pointer; text-align: center; text-decoration: none; font: 14px/100% Arial, Helvetica, sans-serif; padding: .5em 2em .55em; text-shadow: 0 1px 1px rgba(0,0,0,.3); -webkit-border-radius: .5em; -moz-border-radius: .5em; border-radius: .5em; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2); box-shadow: 0 1px 2px rgba(0,0,0,.2); } .button:hover { text-decoration: none; } .button:active { position: relative; top: 1px; } /* white */ .white { color: #606060; border: solid 1px #b7b7b7; background: #fff; background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed)); background: -moz-linear-gradient(top, #fff, #ededed); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed'); } .white:hover { background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc)); background: -moz-linear-gradient(top, #fff, #dcdcdc); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc'); } .white:active { color: #999; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff)); background: -moz-linear-gradient(top, #ededed, #fff); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff'); use UniLabel.Caption = <a href="#" class="button white" target=_blank>...</a> Quote
Guest tendon Posted April 4, 2012 Posted April 4, 2012 Accessing ExtControl.Id gives me an access violation; and I don't see ExtControl as a property in the palette. Is it supposed to be private or protected somehow? Quote
Administrators Farshad Mohajeri Posted April 4, 2012 Administrators Posted April 4, 2012 Accessing ExtControl.Id gives me an access violation; and I don't see ExtControl as a property in the palette. Is it supposed to be private or protected somehow? It can only be accessed in webmode. Quote
Guest tendon Posted April 4, 2012 Posted April 4, 2012 It can only be accessed in webmode. Farshad, what do you mean "in webmode"? I made the call from within... procedure TMainForm.UniFormCreate(Sender: TObject); ... should that be guarded with something like "if webmode then... " or what do you mean? Quote
Administrators Farshad Mohajeri Posted April 4, 2012 Administrators Posted April 4, 2012 Farshad, what do you mean "in webmode"? I made the call from within... procedure TMainForm.UniFormCreate(Sender: TObject); ... should that be guarded with something like "if webmode then... " or what do you mean? if WebMode then begin end; Quote
Guest tendon Posted April 5, 2012 Posted April 5, 2012 if WebMode then begin end; Thanks, that worked. Quote
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.