forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Superpumped Superscripts

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Wed Jan 23, 2013 8:57 pm    Post subject: Superpumped Superscripts Reply with quote

Here is the example of using subscripts and superscripts with standard font with Clearwin. Both clearly have shift to the upside (see first magnified image below) . Would be great just to move all of them several pixels down like it is shown in the bottom excerpt below, with superscript probably a bit more

Also, would be great to have an option for fonts to be printed OVER the background image, not substituting the whole area under the character like it is photoshopped in bottom excerpt which definitely makes the whole GUI look more professional

Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Wed Jan 23, 2013 9:13 pm    Post subject: Reply with quote

%eq will respond to %`bg as in the modified version of your code...

Code:
use clrwin
i=winio@('%ww&')
i=winio@('%ac[esc]&','exit')
i=winio@('%tc&',rgb@(210,227,220))
i=winio@('%bg&',rgb@(11,18,79))
i=winio@('%`bg&',rgb@(0,100,0))
i=winio@('%1.2ob&')
i=winio@('%eq[E=MC{sup 2}]&',0L,0L)
i=winio@('%cb&')
i=winio@('%cn%bc%bu[white]%bt[Exit]%ff&',rgb@(104,23,9))
i=winio@('%cb')
end
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Wed Jan 23, 2013 10:11 pm    Post subject: Reply with quote

Yes, i know that, but tried several times i failed to decrease the size of the formula letters almost twice to fit into the text, the %ts does not work with it... Here is example (sorry box is misfit - i did not adjust it yet after switching from XP)




Is it really not possible to adjust the heights of superscripts %su %$sd ? They are clearly way, way OFF!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Wed Jan 23, 2013 11:13 pm    Post subject: Reply with quote

I am aware that %eq has significant limitations.
I will but this on the wish list.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Thu Jan 24, 2013 1:10 am    Post subject: Reply with quote

Thanks. Also, one related question/request: if printing text over existing background without wiping everything under it is not possible - then may be is it possible to define the background color under the text? For example last picture looks really ugly on this background but if we were able to set the right background (see the quick photoshopped attempt below) according to the used texture the result would be much better and possibly not dependent on different OS defaults (currently you change OS and all your GUI needs whole new set of backgrounds!):

Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Thu Jan 24, 2013 9:06 am    Post subject: Reply with quote

For most controls the background colour can be set using %`bg beforehand.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Thu Jan 24, 2013 11:56 pm    Post subject: Reply with quote

Yes, it works for the $eq , thanks.

But unfortunately does not for the other comments and texts (see above first and second pictures) which i usually place using this way

Code:
i=winio@('Intensity [W/cm2] %ta%rf&',Intens)


Probably %`bg%ws will work if put the comments into character variable. Or may be there exist other ways to put background under texture ? The simplest ideal and most intuitive way of course would be the one which does not work :

Code:
i=winio@('%`bgIntensity [W/cm2] %ta%rf&',rgb@(200,200,200), Intens)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Fri Jan 25, 2013 8:57 am    Post subject: Reply with quote

I would expect %`bg%ws to work and I think that this is the way to do it.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Sun Jan 27, 2013 4:42 am    Post subject: Reply with quote

Well...i tried but... The use of %rs (%ws by some reason does not work) here would be very inconvenient for complex GUIs, it's OK only for few occasional uses

Besides if it is possible to write

i=winio@('%tc[red] Intensity, W/cm2 %rf&', IWpcm2)

and it works fine, everyone would expect from Clearwin that this will also work but it does not

i=winio@('%`bg[red] Intensity, W/cm2 %rf&', IWpcm2)

Please look if you can add that, that will substantially improve the look of GUIs and mostly solve the problem of absence of transparency of background under the fonts on the windows with background textures


Last edited by DanRRight on Tue Jan 29, 2013 12:52 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Sun Jan 27, 2013 9:51 am    Post subject: Reply with quote

OK I will see what I can do.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Tue Jan 29, 2013 12:49 am    Post subject: Reply with quote

Thanks, i think if implemented this will be a step to improve intuitive consistency of the language
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Tue Mar 19, 2013 10:56 am    Post subject: Reply with quote

I have had a look at this.

%tc sets the text colour for subsequent text.
%`bg set the background colour for the next control only.

It is admittedly rather confusing for the text "Intensity, W/cm2" to be treated as a control and hence be given a red background but I think we will have to live with this.

If you need to also make the %rf background red then %`bg[red] needs to be repeated.

Code:
i=winio@('%`bg[red] Intensity, W/cm2 %`bg[red]%rf', IWpcm2)


or am I misunderstanding what you are asking for?
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Tue Mar 19, 2013 12:46 pm    Post subject: Reply with quote

Thanks for looking at this. I do not know what is happening, i spent time again looking at this, but anything i do in the larger code does not work. Will investigate again further today. In short, i know all mentioned things and use them. Unusual thing in my case is that adding the %`bg[red] for example has literally zero effect on texts with %wp texture, so i thought that %`bg does not work with it. Your example works though which give the hope that there is some dumb error somewhere or a bug. There are no other %bg in this specific code which could interfere with %`bg. Could be interference with named %ob or with %ps, or %lw or heck knows what in these 15K lines of CWP text...Will kill all additional features one by one and see when this will start working
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1544
Location: South Pole, Antarctica

PostPosted: Sat Mar 30, 2013 12:06 am    Post subject: Reply with quote

I think i found the reason why %`bg does not work in my case. It is because of the use of %sy[3d_raised]

This feature allows us to place nice %wp texture backgrounds everywhere under %ob/cb. We almost never use plain boring default windows without texture. So when texture is used then %`bg[red] for example does not change the background under the text to red! Can it be done somehow?

Here is almost the same example as in other thread http://forums.silverfrost.com/viewtopic.php?t=2455&postdays=0&postorder=asc&start=0

demonstrating that adding %`bg[red] does not change background if %sy[3d_raised] is used. Please take any texture file or one from the mentioned thread and ignore irrelevant callback functions. Two needed lines of text are marked with the !!!<=====

Please also look at sub/superscripts. Just lowering both few pixels down would solve the problem

Code:
 integer  cbMouse, cbRun
 external cbMouse, cbRun
 real*8 Variab1, Variab2, Variab3

 Variab1=1; Variab2=2; Variab3=3
 ix=400; iy =300
 ia=1;ib=0;ic=0;id=0

 i=winio@('%ww[no_border,casts_shadow]&')   
 i=winio@('%sy[3d_raised]&')  !!!<=====
 I=WINIO@('%wp[moon0]&')
 i=winio@('%mn[&File[E&xit]]&','EXIT')
 i=winio@('%ac[esc]&','EXIT')

 i=winio@('%nr%nd&')
 i=winio@('%1.3ob&')
 i=winio@('%rb[1]%rb[2]%rb[3]%rb[4]%ff&', ia,ib,ic,id)
 i=winio@('%cb&')

  i=winio@('%sf%`bg[red]Var1 T%sdhot%`sd  [eV] %ta%`bg[white]%10rf%ff&', Variab1)  !!!<=====
 i=winio@('%cb&')

 i=WINIO@('%cn%^tt[&Run]%ff&', cbRun)

  i=winio@('Var2%su(-Var1)%`su, [cm%su-3%`su]%ta%`bg[white]%10rf%ff&',Variab2)

 i=winio@('%cb &')
 i=winio@('%ob&')

 i=winio@('%pv%`^gr[full_mouse_input,box_selection,user_resize,rgb_colours,black]&',ix, iy, ihw, cbMouse)
 i=winio@('%cb')

 END

 integer function cbMouse()
 use clrwin
 character*20 text20
 real*8 FontSize1
 common iwin_width_, iwin_DEPTH_

 text20 = 'ClearWin+'
 FontSize1 = 14

 LL = len_trim(text20)
 call get_graphical_resolution@(iwin_width_, iwin_DEPTH_ )
 call clear_screen@()

 111 call SELECT_FONT@('Courier New')
     call scale_font@(FontSize1)
     call BOLD_FONT@( 1 )

     call get_text_size@ (text20(1:ll), i_leng, ifontHight)

     if(i_leng.gt.iwin_width_)then
     FontSize1=FontSize1-0.1
     if(FontSize1.le.0.1) goto 100
     goto 111
     endif
     if(ifontHight.gt.iwin_DEPTH_)then
     FontSize1=FontSize1-0.1
     if(FontSize1.le.0.1) goto 100
     goto 111
     endif

 100 iPosX = (iwin_width_ - i_leng)/2
     if(iPosX.lt.0) iPosX = 0

     iPosY = (iwin_DEPTH_ + ifontHight)/2 
     if(iPosY.lt.0) iPosY = 0
   
     icolorSh  = rgb@(255,255,255)
     ix0 = iPosX+1
     iy0 = iPosY+1 
     call draw_text@ (text20(1:LL), ix0, iy0, icolorSh)

     icolorSh  = rgb@(255,55,55)
     ix0 = iPosX   
     iy0 = iPosY   

     call draw_text@ (text20(1:LL), ix0, iy0, icolorSh)
 cbMouse=1
 end
 integer function cbRun()
 use clrwin   
 common iwin_width_, iwin_DEPTH_
 call draw_text@('Good job,',20,iwin_DEPTH_/3, rgb@(255,55,55))
 cbRun=1
 end

 resources
 moon0  BITMAP moon0.bmp


Last edited by DanRRight on Mon Apr 01, 2013 9:17 pm; edited 5 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4910
Location: Salford, UK

PostPosted: Sat Mar 30, 2013 9:00 am    Post subject: Reply with quote

I have logged this for investigation.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group