Skip to content

Commit

Permalink
Better handling of alpha and graphics black
Browse files Browse the repository at this point in the history
Missed off a lot of code from the alpha black and graphics black. This corrects the "invisible" code when it is displayed, the curor type and size. It makes the black behave the same as the other colours.
  • Loading branch information
peterkvt80 committed Jun 8, 2019
1 parent f8082d7 commit 7955fdd
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 152 deletions.
2 changes: 1 addition & 1 deletion HelpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ HelpFrame::HelpFrame(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxS
SetClientSize(wxDefaultSize);
Move(wxDefaultPosition);
HtmlWindow1 = new wxHtmlWindow(this, ID_HTMLWINDOW1, wxPoint(0,72), wxSize(344,384), wxHW_SCROLLBAR_AUTO, _T("ID_HTMLWINDOW1"));
HtmlWindow1->SetPage(_("<html>\n\n<style>\nbody {\n font-family: Helvetica, Arial, Sans-Serif;\n}\n\n</style>\n\n<body>\n<div style=\"border:2px black solid; display: inline-block;\">\n\t<span style=\"display: inline-block; background-color:#FFFFBB\">\n\t\t<b>Special keys</b><br/>\n\t\tPage Up - Show next page of carousel<br/>\n\t\tPage Down - Show previous page of carousel<br/>\n\t\tF11 - Hide/Reveal<br/>\n\t\tCTRL-Z - Undo<br/>\n\t\tAlt-Gr - Show control codes<br/>\n\t</span>\n</div>\n<div style=\"border:2px black solid; display: inline-block;\">\n\t<b>Text colours</b><br/>\n\t<span style=\"display: inline-block;\">\n\t\tShift-F1 - Red text<br/>\n\t\tShift-F2 - Green text<br/>\n\t\tShift-F3 - Yellow text<br/>\n\t\tShift-F4 - Blue text<br/>\n\t\tShift-F5 - Magenta text<br/>\n\t\tShift-F6 - Cyan text<br/>\n\t\tShift-F7 - White text<br/>\n\t\tShift-F8 - Black text (Level 2.5)<br/>\n\t</span>\n\t<b>Graphic colours</b>\tWhen the small graphics cursor is displayed then pressing space will toggle the pixel on and off. Also, the keys q,w,a,s,z,x toggle individual bits within a mosaic character<br/>\n\t<span style=\"display: inline-block; background-color:#BBBBBB\">\n\t\tCtrl-F1 - Graphics red<br/>\n\t\tCtrl-F2 - Graphics green<br/>\n\t\tCtrl-F3 - Graphics yellow<br/>\n\t\tCtrl-F4 - Graphics blue<br/>\n\t\tCtrl-F5 - Graphics magenta<br/>\n\t\tCtrl-F6 - Graphics cyan<br/>\n\t\tCtrl-F7 - Graphics white<br/>\n\t\tCtrl-F8 - Graphics black (Level 2.5)<br/>\n\t</span>\n</div>\n<div style=\"border:2px black solid; display: inline-block;\">\n\t<b>Effects</b><br/>\n\t<span style=\"display: inline-block; background-color:#BBBBBB\">\n\t\tCTRL-H - Flash<br/>\n\t\tCTRL-I - Steady<br/>\n\t\tCTRL-J - End Box<br/>\n\t\tCTRL-K - Start Box<br/>\n\t\tCTRL-L - Normal height<br/>\n\t\tCTRL-M (enter) - Double height<br/>\n\t\tCTRL-R - Conceal display<br/>\n\t\tCTRL-D - Contiguous graphics<br/>\n\t\tCTRL-T - Separated graphics<br/>\n\t\tCTRL-U - Black background<br/>\n\t\tCTRL-B - New background<br/>\n\t\tCTRL-W - Hold graphics<br/>\n\t\tCTRL-X - Release graphics<br/>\n <br/>\n CTRL-BACKSPACE - Delete Row<br/>\n\t</span>\n</div>\n\n</body>\n</html>"));
HtmlWindow1->SetPage(_("<!DOCTYPE html>\n<html>\n<header>\n<meta charset=\"UTF-8\">\n</header>\n\n<style>\nbody {\n font-family: Teletext2, Helvetica, Arial, Sans-Serif;\n background-color: black;\n color: white;\n}\n.black {color:black;background-color:white;}\n.red {color:red;background-color:white}\n.green {color:#00ff00;}\n.yellow {color:yellow;}\n.blue {color:blue;background-color:white;}\n.magenta {color:magenta;}\n.cyan {color:cyan;}\n.white {color:white;}\n.panel {\n display: inline-block;\n background-color:#666666\"\n}\n\n</style>\n\n<body>\n<div>\n\t<span class=\"panel\" >\n\t\t<b style=\"color:yellow;\">SPECIAL KEYS</b><br/>\n\t\tPage Up - Show next page of carousel<br/>\n\t\tPage Down - Show previous page of carousel<br/>\n\t\tF11 - Hide/Reveal<br/>\n\t\tCTRL-Z - Undo<br/>\n\t\tAlt-Gr - Show control codes<br/>\n\t</span>\n</div>\n<div>\n\t<b style=\"color:yellow;\">TEXT COLOURS</b><br/>\n\t<span class=\"panel\">\n\t\t<span class=\"red\">A</span> Shift-F1 - Red text<br/>\n\t\t<span class=\"green\">A</span> Shift-F2 - Green text<br/>\n\t\t<span class=\"yellow\">A</span> Shift-F3 - Yellow text<br/>\n\t\t<span class=\"blue\">A</span> Shift-F4 - Blue text<br/>\n\t\t<span class=\"magenta\">A</span> Shift-F5 - Magenta text<br/>\n\t\t<span class=\"cyan\">A</span> Shift-F6 - Cyan text<br/>\n\t\t<span class=\"white\">A</span> Shift-F7 - White text<br/>\n\t\t<span class=\"black\">A</span> Shift-F8 - Black text<br/>\n\t</span><br/>\n\t<b style=\"color:yellow;\">GRAPHIC COLOURS</b><br/>\n\tWhen the small graphics cursor is displayed then pressing space will toggle the pixel on and off.<br/>\n\t<span class=\"panel\" >\n\t\t<span class=\"red\">&#xe69b;</span> Ctrl-F1 - Graphics red<br/>\n\t\t<span class=\"green\">&#xe69b;</span> Ctrl-F2 - Graphics green<br/>\n\t\t<span class=\"yellow\">&#xe69b;</span> Ctrl-F3 - Graphics yellow<br/>\n\t\t<span class=\"blue\">&#xe69b;</span> Ctrl-F4 - Graphics blue<br/>\n\t\t<span class=\"magenta\">&#xe69b;</span> Ctrl-F5 - Graphics magenta<br/>\n\t\t<span class=\"cyan\">&#xe69b;</span> Ctrl-F6 - Graphics cyan<br/>\n\t\t<span class=\"white\">&#xe69b;</span> Ctrl-F7 - Graphics white<br/>\n\t\t<span class=\"black\">&#xe69b;</span> Ctrl-F8 - Graphics black<br/>\n\t</span>\n</div>\n<div class=\"panel\">\n\t<b style=\"color:yellow;\">EFFECTS</b><br/>\n\t<span>\n\t\tCTRL-H - Flash<br/>\n\t\tCTRL-I - Steady<br/>\n\t\tCTRL-J - End Box<br/>\n\t\tCTRL-K - Start Box<br/>\n\t\tCTRL-L - Normal height<br/>\n\t\tCTRL-M (enter) - Double height<br/>\n\t\tCTRL-R - Conceal display<br/>\n\t\tCTRL-Y - Contiguous graphics<br/>\n\t\tCTRL-T - Separated graphics<br/>\n\t\tCTRL-U - Black background<br/>\n\t\tCTRL-B - New background<br/>\n\t\tCTRL-W - Hold graphics<br/>\n\t\tCTRL-X - Release graphics<br/>\n\t</span>\n</div>\n\n</body>\n</html>"));
//*)
}

Expand Down
75 changes: 48 additions & 27 deletions help.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,69 @@
<!DOCTYPE html>
<html>
<header>
<meta charset="UTF-8">
</header>

<style>
body {
font-family: Helvetica, Arial, Sans-Serif;
font-family: Teletext2, Helvetica, Arial, Sans-Serif;
background-color: black;
color: white;
}
.black {color:black;background-color:white;}
.red {color:red;background-color:white}
.green {color:#00ff00;}
.yellow {color:yellow;}
.blue {color:blue;background-color:white;}
.magenta {color:magenta;}
.cyan {color:cyan;}
.white {color:white;}
.panel {
display: inline-block;
background-color:#666666"
}

</style>

<body>
<div style="border:2px black solid; display: inline-block;">
<span style="display: inline-block; background-color:#FFFFBB">
<b>Special keys</b><br/>
<div>
<span class="panel" >
<b style="color:yellow;">SPECIAL KEYS</b><br/>
Page Up - Show next page of carousel<br/>
Page Down - Show previous page of carousel<br/>
F11 - Hide/Reveal<br/>
CTRL-Z - Undo<br/>
Alt-Gr - Show control codes<br/>
</span>
</div>
<div style="border:2px black solid; display: inline-block;">
<b>Text colours</b><br/>
<span style="display: inline-block;">
Shift-F1 - Red text<br/>
Shift-F2 - Green text<br/>
Shift-F3 - Yellow text<br/>
Shift-F4 - Blue text<br/>
Shift-F5 - Magenta text<br/>
Shift-F6 - Cyan text<br/>
Shift-F7 - White text<br/>
</span>
<b>Graphic colours</b> When the small graphics cursor is displayed then pressing space will toggle the pixel on and off.<br/>
<span style="display: inline-block; background-color:#BBBBBB">
Ctrl-F1 - Graphics red<br/>
Ctrl-F2 - Graphics green<br/>
Ctrl-F3 - Graphics yellow<br/>
Ctrl-F4 - Graphics blue<br/>
Ctrl-F5 - Graphics magenta<br/>
Ctrl-F6 - Graphics cyan<br/>
Ctrl-F7 - Graphics white<br/>
<div>
<b style="color:yellow;">TEXT COLOURS</b><br/>
<span class="panel">
<span style="background-color:white;color:red;">A</span> Shift-F1 - Red text<br/>
<span class="green">A</span> Shift-F2 - Green text<br/>
<span class="yellow">A</span> Shift-F3 - Yellow text<br/>
<span class="blue">A</span> Shift-F4 - Blue text<br/>
<span class="magenta">A</span> Shift-F5 - Magenta text<br/>
<span class="cyan">A</span> Shift-F6 - Cyan text<br/>
<span class="white">A</span> Shift-F7 - White text<br/>
<span class="black">A</span> Shift-F8 - Black text<br/>
</span><br/>
<b style="color:yellow;">GRAPHIC COLOURS</b><br/>
When the small graphics cursor is displayed then pressing space will toggle the pixel on and off.<br/>
<span class="panel" >
<span class="red">&#xe69b;</span> Ctrl-F1 - Graphics red<br/>
<span class="green">&#xe69b;</span> Ctrl-F2 - Graphics green<br/>
<span class="yellow">&#xe69b;</span> Ctrl-F3 - Graphics yellow<br/>
<span class="blue">&#xe69b;</span> Ctrl-F4 - Graphics blue<br/>
<span class="magenta">&#xe69b;</span> Ctrl-F5 - Graphics magenta<br/>
<span class="cyan">&#xe69b;</span> Ctrl-F6 - Graphics cyan<br/>
<span class="white">&#xe69b;</span> Ctrl-F7 - Graphics white<br/>
<span class="black">&#xe69b;</span> Ctrl-F8 - Graphics black<br/>
</span>
</div>
<div style="border:2px black solid; display: inline-block;">
<b>Effects</b><br/>
<span style="display: inline-block; background-color:#BBBBBB">
<div class="panel">
<b style="color:yellow;">EFFECTS</b><br/>
<span>
CTRL-H - Flash<br/>
CTRL-I - Steady<br/>
CTRL-J - End Box<br/>
Expand Down
17 changes: 13 additions & 4 deletions ttxline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,25 @@ bool TTXLine::IsDoubleHeight(int xLoc=39)
// If the line we are testing isn't long enough, just check the last character.
// std::cout << m_textline << std::endl;
if (m_textline.empty())
{
return false;
}
if (m_textline.length()<x)
{
x=m_textline.length()-1;
}
for (unsigned int i=0;i<=x;i++)
{
if (m_textline[i]=='\r' || m_textline[i]==0x10)
doubleHeight=true;
if (m_textline[i]=='\r') // || m_textline[i]==0x10) // Probably mean to write 10 (LF) 0x10=GfxBlack
{
doubleHeight=true;
}
if (m_textline[i]=='\x12')
doubleHeight=false;
{
doubleHeight=false;
}
}
return doubleHeight;
return doubleHeight;
}

bool TTXLine::IsBlank()
Expand Down Expand Up @@ -200,6 +208,7 @@ bool TTXLine::IsAlphaMode(int loc)
case ttxCodeAlphaWhite:;
result=true;
break;
case ttxCodeGraphicsBlack:;
case ttxCodeGraphicsRed:;
case ttxCodeGraphicsGreen:;
case ttxCodeGraphicsYellow:;
Expand Down
1 change: 1 addition & 0 deletions ttxpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ TTXPage::TTXPage(std::string filename, std::string shortFilename) : undoList(nul
{
SetRow(1,"Unable to load file");
SetRow(3,shortFilename);
SetRow(4,"?");
SetSourcePage("Unable to load page");
SetShortFilename("no page");
}
Expand Down
Loading

0 comments on commit 7955fdd

Please sign in to comment.