Skip to content

Commit

Permalink
wx and wxc portions of hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Feb 23, 2016
1 parent a833aca commit 953943f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions wx/src/Graphics/UI/WX/Classes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Graphics.UI.WX.Classes

-- * Text
, Textual(text,appendText)
, Hints(hint)
, Literate(font ,fontFamily, fontFace, fontSize, fontWeight, fontUnderline, fontShape
,textColor,textBgcolor)
-- * Rendering
Expand Down Expand Up @@ -78,6 +79,10 @@ class Textual w where
appendText w s
= set w [text :~ (++s)]

-- | Widgets that can display a hint
class Hints w where
-- | The hint displayed by a widget
hint :: Attr w String

-- | Widgets with a picture.
class Pictured w where
Expand Down
13 changes: 12 additions & 1 deletion wxc/src/cpp/eljtextctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,18 @@ EWXWEXPORT(bool,wxTextCtrl_CanRedo)(wxTextCtrl* self)
{
return self->CanRedo();
}


EWXWEXPORT(wxString*,wxTextCtrl_GetHint)(wxTextCtrl* self)
{
wxString *result = new wxString();
*result = self->GetHint();
return result;
}
EWXWEXPORT(bool,wxTextCtrl_SetHint)(wxTextCtrl* self,wxString *hint)
{
self->SetHint(*hint);
}

EWXWEXPORT(void,wxTextCtrl_SetInsertionPoint)(wxTextCtrl* self,long pos)
{
self->SetInsertionPoint(pos);
Expand Down
2 changes: 2 additions & 0 deletions wxc/src/include/wxc_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -5181,6 +5181,7 @@ void wxTextCtrl_Copy( TSelf(wxTextCtrl) _obj );
TClass(wxTextCtrl) wxTextCtrl_Create( TClass(wxWindow) _prt, int _id, TClass(wxString) _txt, TRect(_lft,_top,_wdt,_hgt), long _stl );
void wxTextCtrl_Cut( TSelf(wxTextCtrl) _obj );
void wxTextCtrl_DiscardEdits( TSelf(wxTextCtrl) _obj );
TClass(wxString) wxTextCtrl_GetHint( TSelf(wxTextCtrl) _obj );
long wxTextCtrl_GetInsertionPoint( TSelf(wxTextCtrl) _obj );
long wxTextCtrl_GetLastPosition( TSelf(wxTextCtrl) _obj );
int wxTextCtrl_GetLineLength( TSelf(wxTextCtrl) _obj, long lineNo );
Expand All @@ -5198,6 +5199,7 @@ void wxTextCtrl_Remove( TSelf(wxTextCtrl) _obj, long from, long to );
void wxTextCtrl_Replace( TSelf(wxTextCtrl) _obj, long from, long to, TClass(wxString) value );
TBool wxTextCtrl_SaveFile( TSelf(wxTextCtrl) _obj, TClass(wxString) file );
void wxTextCtrl_SetEditable( TSelf(wxTextCtrl) _obj, TBool editable );
bool wxTextCtrl_SetHint( TSelf(wxTextCtrl) _obj, TClass(wxString) hint );
void wxTextCtrl_SetInsertionPoint( TSelf(wxTextCtrl) _obj, long pos );
void wxTextCtrl_SetInsertionPointEnd( TSelf(wxTextCtrl) _obj );
void wxTextCtrl_SetSelection( TSelf(wxTextCtrl) _obj, long from, long to );
Expand Down

0 comments on commit 953943f

Please sign in to comment.