Merge continued

git-svn-id: svn://ultimatepp.org/upp/trunk@10263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-10-04 08:34:39 +00:00
parent 2582d7f364
commit 3cd394812c
3860 changed files with 1161787 additions and 438 deletions

View file

@ -0,0 +1,9 @@
uses
CtrlLib,
VectorDes;
file
main.cpp;
mainconfig
"" = "MT GUI";

View file

@ -0,0 +1,12 @@
TITLE("Main Window")
TOPIC_TEXT(
"[ $$0,0#00000000000000000000000000000000:Default][*4 $$1,1#22455421400550903415511487106331:Heading1][b83;*+117 "
"$$2,2#10265389466432309521571218171310:Heading2][{_}%EN-US [s1; The Main Window&][s0; "
"The following is a vector diagram that causes the application to crash when viewed "
"as help.&][s0; &][s0;= @@VectorImage:2238&1482\236\202\377\377\377\377\326\311\240\315\341\356\300\363\277\365\203\276\367\357\303\312\362\344\212\344\276\364\276\340\364\301\250\261\314\362\276\377\276\371\217\276\331\276\304\364\301\262\254\313\362\276\350\355\277\315\201\276\360\364\301\263\256&][s0; "
"&][")
TOPIC_TEXT(
"s0; The following is a table whose Description column disappears when viewed as "
"help.&][ {{1582:1969:6449>1856;h1;b17/15 [s0; Value]:: [s0; Symbol]:: [s0; Description]::b0/15 "
"[s0;2 0]:: [s0;2 NULL]:: [s0;2 Null]:: [s0;2 1]:: [s0;2 SOH]:: [s0;2 [%00-00 Start "
"of Heading]]:: [s0;2 2]:: [s0;2 SOT]:: [s0;2 Start of Text]}}&][s0; ]")

View file

@ -0,0 +1,3 @@
TOPIC("Overview$en-us")
#include "Overview$en-us.tpp"
END_TOPIC

View file

@ -0,0 +1,74 @@
// When running this application and the help button is pressed the program crashes.
// Using the Topic++ editor the help file is edited fine.
// Using the Topic browser the table fails to show the left column of the table.
// Note it is important to use the full path as provided. ie MyApp should contain directory Bugs with HelpBug under it.
// If not then it will not crash, although it will still fail to show anything.
#include <CtrlLib/CtrlLib.h>
#define TOPICFILE <Bugs/HelpBug/Manual.tpp/all.i>
#include <Core/topic_group.h>
// ============================================================================
class APP : public TopWindow {
MenuBar Menu;
ToolBar Toolbar;
HelpWindow Help;
void ShowManual();
void SetToolBar();
void MainMenu(Bar &bar);
void HelpMenu(Bar &bar);
void MakeToolbar(Bar &bar);
public:
typedef APP CLASSNAME;
APP();
}*TheApp;
// ----------------------------------------------------------------------------
APP::APP() {
AddFrame(Menu);
AddFrame(TopSeparatorFrame());
AddFrame(Toolbar);
Menu.Set(callback(this,&CLASSNAME::MainMenu));
Menu.WhenHelp = Toolbar.WhenHelp;
SetToolBar();
OpenMain();
}
// ----------------------------------------------------------------------------
void APP::HelpMenu(Bar &bar) {
bar.Add(t_("Manual.."),CtrlImg::help(),callback(this,&CLASSNAME::ShowManual)).Key(K_F1).Help(t_("Provides a manual"));
}
// ----------------------------------------------------------------------------
void APP::MainMenu(Bar &bar) {
bar.Add(t_("Help"), callback(this,&CLASSNAME::HelpMenu));
}
// ----------------------------------------------------------------------------
void APP::MakeToolbar(Bar &bar) {
HelpMenu(bar);
}
// ----------------------------------------------------------------------------
void APP::SetToolBar() {
Toolbar.Set(callback(this,&CLASSNAME::MakeToolbar));
}
// ----------------------------------------------------------------------------
void APP::ShowManual() {
Help.GoTo("topic://Bugs/HelpBug/Manual/Overview$en-us");
Help.Execute();
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
GUI_APP_MAIN {
SetLanguage(LNG_ENGLISH);
TheApp = new APP;
Ctrl::EventLoop();
delete TheApp; // To stop heap leaks warning
}

View file

@ -0,0 +1,12 @@
uses
CtrlLib;
file
"Bugs/LineEditScroll.h"
, main.cpp
;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,6 @@
#ifndef _LineEditScroll_LineEditScroll_h
#define _LineEditScroll_LineEditScroll_h
#include <CtrlLib/CtrlLib.h>
#endif

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
LineEditScroll.h,
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,67 @@
#include "LineEditScroll.h"
class ScrollBugWindow : public TopWindow {
public:
typedef ScrollBugWindow CLASSNAME;
ScrollBugWindow();
private:
void Animate();
private:
LineEdit editor;
Vector<char> matrix;
enum { WIDTH = 80, HEIGHT = 160 };
Point pos;
int sync_ticks;
TimeCallback tc_anim;
};
ScrollBugWindow::ScrollBugWindow()
{
matrix.SetCount(WIDTH * HEIGHT, ' ');
pos = Point(0, 0);
sync_ticks = msecs();
Add(editor.SizePos());
Sizeable().Zoomable();
Title("Line editor scrolling bug");
tc_anim.Set(-10, THISBACK(Animate));
}
void ScrollBugWindow::Animate()
{
String rowfmt = NFormat("Row #%d: ", pos.y + 1);
rowfmt.Cat('*', pos.y + 1);
rowfmt << " \\";
matrix[pos.y * WIDTH + pos.x] = (pos.x < rowfmt.GetLength() ? rowfmt[pos.x] : ' ');
if(pos.x & 1) {
if(--pos.y < 0) {
pos.y = 0;
pos.x++;
}
}
else {
if(++pos.y >= HEIGHT) {
pos.y = HEIGHT - 1;
pos.x++;
}
}
if(pos.x >= WIDTH) {
Fill(matrix.Begin(), matrix.End(), ' ');
pos = Point(0, 0);
}
if(msecs(sync_ticks) >= 500) {
String text;
for(int i = 0; i < HEIGHT; i++) {
text.Cat(matrix.GetIter(i * WIDTH), WIDTH);
text.Cat('\n');
}
editor <<= text;
sync_ticks = msecs();
}
}
GUI_APP_MAIN
{
ScrollBugWindow().Run();
}