FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse SaveState() to save font?
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
xBrowse SaveState() to save font?
Posted: Wed Oct 26, 2016 07:06 PM

Hello everyone;

Using GetFont() and SelFont() you give the user access to change xbrowse's font.

Is there a way to save an xbrowse selected font and then restore back to that font next time it opens?

I've tried oBrw:savestate() but it seems like it doesn't save font information.

Thank you,

Reinaldo.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse SaveState() to save font?
Posted: Wed Oct 26, 2016 11:18 PM
I suggest these functions

Code (fw): Select all Collapse
function SaveBrwFont( oBrw )
return FontToText( oBrw:Font )

You may save the result text wherever
Code (fw): Select all Collapse
function RestoreBrwFont( oBrw, cFontText )
   oBrw:SetFont( FontFromText( cFontText ) )
return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: xBrowse SaveState() to save font?
Posted: Thu Oct 27, 2016 01:44 PM

Thank you, Rao. That will work perfectly.

Reinaldo.

Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: xBrowse SaveState() to save font?
Posted: Thu Oct 27, 2016 02:24 PM

Just a small clarification. Mr. Rao meant oBrw:oFont instead of oBrw:Font. It works perfectly as expected.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse SaveState() to save font?
Posted: Thu Oct 27, 2016 07:32 PM
reinaldocrespo wrote:Just a small clarification. Mr. Rao meant oBrw:oFont instead of oBrw:Font. It works perfectly as expected.

You are right. It was my typing mistake. Thanks.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion