Skip to content

Commit

Permalink
Support to change font family
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Oct 15, 2023
1 parent cef27f6 commit 21838bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/ccontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class CControl:public CObject
int ChildCount;
lxString FontName;
uint FontSize;
int FontFamily;
CControl *Owner;
bool Visible;
CPMenu *PopupMenu;
Expand Down Expand Up @@ -93,6 +94,7 @@ class CControl:public CObject
void SetDragAcceptFiles(bool accept);
//propiedades
void SetFont (const lxString font);
void SetFontFamily (const int family);
lxString GetFontName (void);
void SetFontSize (uint size);
uint GetFontSize (void);
Expand Down
11 changes: 11 additions & 0 deletions lib/ccontrol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,17 @@ uint CControl::GetFontSize (void)
return FontSize;
}

void
CControl::SetFontFamily(int family)
{
FontFamily = family;
if (Widget != NULL){
wxFont font= Widget->GetFont();
font.SetFamily(static_cast<wxFontFamily>(family));
Widget->SetFont(font);
}
}

void
CControl::SetHint (lxString hint)
{
Expand Down

0 comments on commit 21838bc

Please sign in to comment.