Characters from different code tables

Post Reply
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Characters from different code tables

Post by Natter »

Hi,

Is it possible to show text in the xBrowse cell with characters inserted into it from another code table
(for example, superscript characters of space or volume. As in Word/Excel) ?
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Characters from different code tables

Post by nageswaragunupudi »

I can tell you this much.
If the string appears correctly using "?" command, it will appear the same way in XBrowse also.
First, test with

Code: Select all | Expand

? cText
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Characters from different code tables

Post by Natter »

Good.
Is it possible to use different fonts in the same row (not in different rows) of the cell ?
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Characters from different code tables

Post by nageswaragunupudi »

superscript characters of space or volume
Please give some examples and let us try now.
Any character can also be expressed in utf8. Then we can concatenate all utf8 characters
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Characters from different code tables

Post by nageswaragunupudi »

Please first see the functioning of the function

Code: Select all | Expand

FW_SayTextHilite( hDC, cText, aRect, oFont, nClrText, nClrBack, aWords )
This is an example how to use:

Code: Select all | Expand

function TestHilite()

   local oWnd
   local cText := "We always eat dinner together"
   local aWords
   local oFont, oBold, oItalic

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-22
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-25 BOLD
   DEFINE FONT oItalic NAME "TIMES NEW ROMAN" SIZE 0,-25 ITALIC

   aWords   := {  { "ALWAYS", oBold, CLR_HRED, CLR_YELLOW }, ;
                  { "DINNER", oItalic, CLR_GREEN, CLR_HGRAY }, ;
                  { "TOGETHER", oItalic, CLR_WHITE, CLR_RED } }

   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   oWnd:bPainted  := <|hDC|
      local aRect    := GetClientRect( oWnd:hWnd )
      aRect[ 2 ] += 100
      FW_SayTextHilite( hDC, cText, aRect, oFont, ;
            CLR_BLACK, CLR_WHITE, aWords )
      return nil
      >
   ACTIVATE WINDOW oWnd CENTERED

   RELEASE FONTS oFont, oBold, oItalic

return nil
Image

Now you have to use this function to paint text in a cell by defining your own codeblock:

Code: Select all | Expand

oCol:bPaintText
This codeblock is evaluated like this:

Code: Select all | Expand

Eval( ::bPaintText, Self, hDC, cStrData, oRect:aRect, aColors, lHighLite, lSelected )
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Characters from different code tables

Post by Natter »

Thanks! This is what I need
Post Reply