xBrowse SaveState() to save font?

xBrowse SaveState() to save font?

Postby reinaldocrespo » Wed Oct 26, 2016 7: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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse SaveState() to save font?

Postby nageswaragunupudi » Wed Oct 26, 2016 11:18 pm

I suggest these functions

Code: Select all  Expand view
function SaveBrwFont( oBrw )
return FontToText( oBrw:Font )
 

You may save the result text wherever
Code: Select all  Expand view

function RestoreBrwFont( oBrw, cFontText )
   oBrw:SetFont( FontFromText( cFontText ) )
return nil
 
Regards

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

Re: xBrowse SaveState() to save font?

Postby reinaldocrespo » Thu Oct 27, 2016 1:44 pm

Thank you, Rao. That will work perfectly.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse SaveState() to save font?

Postby reinaldocrespo » Thu Oct 27, 2016 2:24 pm

Just a small clarification. Mr. Rao meant oBrw:oFont instead of oBrw:Font. It works perfectly as expected.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse SaveState() to save font?

Postby nageswaragunupudi » Thu Oct 27, 2016 7: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 66 guests