Skip to content

Commit

Permalink
Mac can't set bg color of editor (2.6 bug)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/ucblogo/code@206 fc4ef4ee-df3e-0410-84de-fb01f5d6c4f7
  • Loading branch information
brianharvey committed Sep 14, 2008
1 parent 665d533 commit a3598a9
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 73 deletions.
18 changes: 17 additions & 1 deletion TextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ wxTextCtrl(f, a, s, p, sz, b)

void TextEditor::SetFont(wxFont font){
this->font = font;
#ifdef __WXMAC__
SetDefaultStyle(wxTextAttr(wxNullColour,wxNullColour, font));
if(this->IsShown()){
SetStyle(0,GetLastPosition(), wxTextAttr(wxNullColour,wxNullColour,font));
#else
SetDefaultStyle(wxTextAttr(TurtleCanvas::colors[wxTerminal::terminal->m_curFG],
TurtleCanvas::colors[wxTerminal::terminal->m_curBG], font));
if(this->IsShown()){
Expand All @@ -50,18 +55,29 @@ void TextEditor::SetFont(wxFont font){
TurtleCanvas::colors[wxTerminal::terminal->m_curBG],font));
SetBackgroundColour(
TurtleCanvas::colors[wxTerminal::terminal->m_curBG]);
#endif
Refresh();
Update();
}
}

void TextEditor::SetThisFont(wxCommandEvent& event) {
#ifdef __WXMAC__
SetDefaultStyle(wxTextAttr(wxNullColour,wxNullColour, this->font));
if(this->IsShown()){
SetStyle(GetLastPosition()-1, GetLastPosition(), wxTextAttr(wxNullColour,wxNullColour,this->font));
#else
SetDefaultStyle(wxTextAttr(TurtleCanvas::colors[wxTerminal::terminal->m_curFG],
TurtleCanvas::colors[wxTerminal::terminal->m_curBG], this->font));
if(this->IsShown()){
SetStyle(0,GetLastPosition(),
SetStyle(GetLastPosition()-1, GetLastPosition(),
wxTextAttr(TurtleCanvas::colors[wxTerminal::terminal->m_curFG],
TurtleCanvas::colors[wxTerminal::terminal->m_curBG],this->font));
SetBackgroundColour(
TurtleCanvas::colors[wxTerminal::terminal->m_curBG]);
#endif
Refresh();
Update();
Refresh();
Update();
}
Expand Down
142 changes: 71 additions & 71 deletions helpfiles/HELPCONTENTS
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
Help is available on the following:

` dribble lessp popl setmargins
< edall list popls setpalette
<= edit listp pops setpen
<> editfile listtoarray pos setpencolor
= edn ln pot setpenpattern
> edns load pots setpensize
>= edpl loadnoisily power setpos
- edpls loadpict pprop setprefix
/ edps local prefix setread
* emptyp localmake primitivep setreadpos
+ eofp log10 primitives setscrunch
allopen epspict logoplatform print .setsegmentsize
allowgetset .eq logoversion printdepthlimit settemploc
and equalp lowercase printout settextcolor
apply erall lput printwidthlimit settextsize
arc erase lshift procedurep setwrite
arctan erasefile .macro procedures setwritepos
arity ern macroexpand product setx
array erns macrop push setxy
arrayp erpl make queue sety
arraytolist erpls map quoted shell
ascii erps map.se quotient show
ashift erract .maybeoutput radarctan shownp
back error mdarray radcos showturtle
background exp mditem radsin sin
beforep fence mdsetitem random splitscreen
bitand filep member rawascii sqrt
bitnot fill memberp readchar standout
bitor filled minus readchars startup
bitxor filter modulo reader step
buried find mousepos readlist stepped
buriedp first name readpos steppedp
bury firsts namelist readrawline stop
buryall font namep readword substringp
buryname for names redefp sum
butfirst foreach nodes reduce tag
butfirsts forever nodribble refresh test
butlast form norefresh remainder text
button forward not remdup textscreen
buttonact fput notequalp remove textsize
buttonp fullprintp numberp remprop thing
bye fullscreen openappend repcount throw
cascade fulltext openread repeat to
case gc openupdate rerandom towards
caseignoredp gensym openwrite reverse trace
catch global or right traced
char goto output round tracedp
clean gprop palette rseq transfer
clearscreen greaterequalp parse run turtlemode
cleartext greaterp pause runparse type
clickpos heading pen runresult unbury
close help pencolor save unburyall
closeall hideturtle pendown savel unburyname
combine home pendownp savepict unburyonedit
commandline if penerase screenmode unstep
cond ifelse penmode scrunch until
contents iffalse penpaint sentence untrace
continue iftrue penpattern setbackground uppercase
copydef ignore penreverse .setbf usealternatenam
cos increasefont pensize setcslsloc vbarredp
count int penup setcursor wait
crossmap invoke pick seteditor while
cslsload iseq plist .setfirst window
cursor item plistp setfont word
define keyact plists setheading wordp
definedp keyp pllist sethelploc wrap
.defmacro label poall setitem writepos
dequeue labelsize pon .setitem writer
difference last pons setlabelheight xcor
do.until left pop setlibloc ycor
do.while lessequalp
* cursor keyp pon setpalette
+ define label pons setpen
- definedp labelsize pop setpencolor
.defmacro dequeue last popl setpenpattern
.eq difference left popls setpensize
.macro do.until lessequalp pops setpos
.maybeoutput do.while lessp pos setprefix
.setbf dribble list pot setread
.setfirst edall listp pots setreadpos
.setitem edit listtoarray power setscrunch
.setsegmentsize editfile ln pprop settemploc
/ edn load prefix settextcolor
< edns loadnoisily primitivep settextsize
<= edpl loadpict primitives setwrite
<> edpls local print setwritepos
= edps localmake printdepthlimit setx
> emptyp log10 printout setxy
>= eofp logoplatform printwidthlimit sety
` epspict logoversion procedurep shell
allopen equalp lowercase procedures show
allowgetset erall lput product shownp
and erase lshift push showturtle
apply erasefile macroexpand queue sin
arc ern macrop quoted splitscreen
arctan erns make quotient sqrt
arity erpl map radarctan standout
array erpls map.se radcos startup
arrayp erps mdarray radsin step
arraytolist erract mditem random stepped
ascii error mdsetitem rawascii steppedp
ashift exp member readchar stop
back fence memberp readchars substringp
background filep minus reader sum
beforep fill modulo readlist tag
bitand filled mousepos readpos test
bitnot filter name readrawline text
bitor find namelist readword textscreen
bitxor first namep redefp textsize
buried firsts names reduce thing
buriedp font nodes refresh throw
bury for nodribble remainder to
buryall foreach norefresh remdup towards
buryname forever not remove trace
butfirst form notequalp remprop traced
butfirsts forward numberp repcount tracedp
butlast fput openappend repeat transfer
button fullprintp openread rerandom turtlemode
buttonact fullscreen openupdate reverse type
buttonp fulltext openwrite right unbury
bye gc or round unburyall
cascade gensym output rseq unburyname
case global palette run unburyonedit
caseignoredp goto parse runparse unstep
catch gprop pause runresult until
char greaterequalp pen save untrace
clean greaterp pencolor savel uppercase
clearscreen heading pendown savepict usealternatenam
cleartext help pendownp screenmode vbarredp
clickpos hideturtle penerase scrunch wait
close home penmode sentence while
closeall if penpaint setbackground window
combine ifelse penpattern setcslsloc word
commandline iffalse penreverse setcursor wordp
cond iftrue pensize seteditor wrap
contents ignore penup setfont writepos
continue increasefont pick setheading writer
copydef int plist sethelploc xcor
cos invoke plistp setitem ycor
count iseq plists setlabelheight
crossmap item pllist setlibloc
cslsload keyact poall setmargins
3 changes: 3 additions & 0 deletions term.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@

#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#ifdef HAVE_SGTTY_H
#include <sgtty.h>
#endif
#else
#ifdef HAVE_TERMLIB_H
#include <termlib.h>
Expand Down
4 changes: 3 additions & 1 deletion wxTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ END_EVENT_TABLE()

#include "ucblogo.xpm"

extern "C" void wxSetTextColor(int fg, int bg);

//this should compute the size based on the chosen font!
LogoFrame::LogoFrame (const wxChar *title,
int xpos, int ypos,
Expand All @@ -346,7 +348,7 @@ LogoFrame::LogoFrame (const wxChar *title,

AdjustSize();


wxSetTextColor(7+SPECIAL_COLORS, 0+SPECIAL_COLORS);
editWindow = new TextEditor( this, -1, _T(""), wxDefaultPosition,
wxSize(100,60), wxTE_MULTILINE|wxTE_RICH, f);
wxTerminal::terminal->isEditFile=0;
Expand Down

0 comments on commit a3598a9

Please sign in to comment.