Characters from different code tables

Characters from different code tables

Postby Natter » Tue Aug 29, 2023 9:11 am

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) ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Characters from different code tables

Postby nageswaragunupudi » Tue Aug 29, 2023 9:51 am

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 view  RUN
? cText
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Characters from different code tables

Postby Natter » Tue Aug 29, 2023 12:48 pm

Good.
Is it possible to use different fonts in the same row (not in different rows) of the cell ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Characters from different code tables

Postby nageswaragunupudi » Tue Aug 29, 2023 3:23 pm

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: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Characters from different code tables

Postby nageswaragunupudi » Tue Aug 29, 2023 4:06 pm

Please first see the functioning of the function
Code: Select all  Expand view  RUN
FW_SayTextHilite( hDC, cText, aRect, oFont, nClrText, nClrBack, aWords )


This is an example how to use:
Code: Select all  Expand view  RUN
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 view  RUN
oCol:bPaintText

This codeblock is evaluated like this:
Code: Select all  Expand view  RUN
Eval( ::bPaintText, Self, hDC, cStrData, oRect:aRect, aColors, lHighLite, lSelected )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Characters from different code tables

Postby Natter » Tue Aug 29, 2023 6:03 pm

Thanks! This is what I need
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests