Jump to content

New Components from TUnimEdit TUnimLabel


RobYost

Recommended Posts

source: https://unigui.miraheze.org/wiki/Main_Page

 

I have created two new controls descended from TUnimEdit and TUnimLabel.

 

added:

  • Font size
  • Font color
  • Font style (Bold, Italics)
  • border size
  • border color

I tried to accomplish this with code like this:

  s := ' document.getElementById("' + edt1.JSName + '_id").style.fontsize = "8px"; ';               // Not works
  UniSession.AddJS(s);

But "Delphi Developer" told me some CSS properties can not be changed and I would need to make the changes with CustomCSS

 

This is more limited because I can't do things like:

s := ' document.getElementById("' + edt1.JSName + '_id").style.fontsize = "'IntToStr(FFont.size) + 'px"; ';   

I have to add all combinations I will need to the CSS:

.fontsize12 {
font-size: 12px;
} .fontsize14 {
font-size: 14px;
}

I created a wiki with the two new components and the CustomCSS file.

Please take a look and make any changes you can think of to make it better.

 

I would rather do the styles in code instead of with CSS file, but I couldn't make it work.  I am not done, but I thought it might be good for someone else to look at it in case there are some basic changes that could be made to make it better.

  • Upvote 1
Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...