summaryrefslogtreecommitdiff
path: root/ycurses/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'ycurses/src/examples')
-rw-r--r--ycurses/src/examples/example1.cpp80
-rw-r--r--ycurses/src/examples/example1.h8
-rw-r--r--ycurses/src/examples/example2.cpp52
-rw-r--r--ycurses/src/examples/example2.h8
-rw-r--r--ycurses/src/examples/example3.cpp45
-rw-r--r--ycurses/src/examples/example3.h8
-rw-r--r--ycurses/src/examples/example4.cpp22
-rw-r--r--ycurses/src/examples/example4.h8
8 files changed, 0 insertions, 231 deletions
diff --git a/ycurses/src/examples/example1.cpp b/ycurses/src/examples/example1.cpp
deleted file mode 100644
index 239e476..0000000
--- a/ycurses/src/examples/example1.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "example1.h"
-
-int example1()
-{
- /* Initialize the ycurses object at first! You MUST also delete this as the last! */
- curses cur;
-
- /* Make the cursor invisible.
- * All available options are:
- * Invisible
- * Visible
- * VeryVisible
- */
- cursor::set_invisible();
-
- /* Get the root-window */
- window win_root(root);
-
- /*
- * There are standard colors defined which can be mixed together to
- * get foreground/background color pairs:
- * Red, Green, Yellow, Blue, Cyan, Magenta and White
- */
- color col1(Cyan, Blue); // 1. With implicit Name.
- // color col1("col1", Cyan, Blue); // 2. With explicit Name.
-
- /* Now we define attributes, and pass them the color */
- attributes attr1(col1);
- win_root.set_attributes(attr1);
-
- /* Print out some text on the cursor location, with line break */
- win_root.println(0, 0, "Hello, welcome to ncurses in cyan-blue");
-
- win_root.unset_attributes(attr1);
-
- /* Create a new centeralized window with the specified height and width */
- window win1(20, 78);
-
- color col2(Yellow, Black);
- attributes attr2(col2);
- attr1.set_bold(true);
-
- win1.set_attributes(attr2);
- win1.print(2, 2, "Print into window at pos 2-2 w/out newline in yellow-black-bold!");
-
- /* Create yet another window */
- window win2(10, 20);
-
- /* Print out the y and the x component of the absolute coordinates of win1 */
- coordinate coord_win(Absolutecoord,win1);
- coordinate coord_text(10,11);
-
- /* Other available coordinates
- *
- * coordinate(Absolutecoord,win1); // Gets window's absolute position.
- * coordinate(Relativecoord,win1); // Gets window's relative position.
- * coordinate(Beginningcoord,win1); // Gets window's beginning coords.
- * coordinate(windowSize,win1); // Gets window's size.
- * coordinate(TerminalSize); // Gets the total terminal size.
- * coordinate(TerminalCenter); // Gets the center of the terminal
- */
-
- attributes attr_bold(Bold);
- // Hint: you can use Normal instead of Bold to set all attributes to default.
-
- win_root.print(coord_text, "Demonstration output", attr_bold);
- win_root.print(coord_text.down(), "coordinate y:");
- win_root.print(coord_text.displace(1,1), coord_win.y, attr_bold);
- win_root.print(coord_text.displace(1,-1), "coordinate x:");
- win_root.print(coord_text.displace(1,1), coord_win.x, attr_bold);
-
- /* Wait for user key stroke */
- cur.pause();
-
- /* Deletes all curses elements from memory, also all pointers
- Because the ycurses Objekt will get out of scope now.
- */
- return 0;
-}
-
diff --git a/ycurses/src/examples/example1.h b/ycurses/src/examples/example1.h
deleted file mode 100644
index dc5e753..0000000
--- a/ycurses/src/examples/example1.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef EXAMPLE1_H
-#define EXAMPLE1_H
-
-#include "../curses/ycurses.h"
-
-int example1();
-
-#endif
diff --git a/ycurses/src/examples/example2.cpp b/ycurses/src/examples/example2.cpp
deleted file mode 100644
index c93d79c..0000000
--- a/ycurses/src/examples/example2.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "example2.h"
-
-int example2()
-{
- curses cur;
- cursor::set_invisible();
-
- window win_root(root);
- win_root.print(1, 1, "Press any key to continue...");
-
- coordinate coord(2, 0);;
-
- window win1(10, 40, coord);
- window win2(10, 40, coord.displace(3, 6));
- window win3(10, 40, coord.displace(3, 6));
-
- win1.print(1, 1, "window 1");
- win2.print(1, 1, "window 2");
- win3.print(1, 1, "window 3");
-
- /* Initialize pwindows. */
- pwindow pwindow1(win1);
- pwindow pwindow2(win2);
- pwindow pwindow3(win3);
-
-
- /* Remove pwindow3, pwindow3 doesnt contain a valid pwindow any more!
- * DONT USE THIS OBJECT AGAIN until re-init!!!
- */
- pwindow3.remove();
-
- /* Re-init a new pwindow, using the old variable. Now the object
- * can be used again.
- */
- pwindow3.reinit(win3);
- cur.pause();
-
- /* Remove the center pwindow. */
- pwindow2.remove();
- win3.print(2, 1, "pwindow 2 removed!");
- cur.pause();
-
- win1.print(2, 1, "Some text!");
- cur.pause();
-
- pwindow3.remove();
- win1.print(3, 1, "pwindow 3 removed!");
- cur.pause();
-
- return 0;
-}
-
diff --git a/ycurses/src/examples/example2.h b/ycurses/src/examples/example2.h
deleted file mode 100644
index fbdc6c7..0000000
--- a/ycurses/src/examples/example2.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef EXAMPLE2_H
-#define EXAMPLE2_H
-
-#include "../curses/ycurses.h"
-
-int example2();
-
-#endif
diff --git a/ycurses/src/examples/example3.cpp b/ycurses/src/examples/example3.cpp
deleted file mode 100644
index 5fee1f8..0000000
--- a/ycurses/src/examples/example3.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "example3.h"
-
-int example3()
-{
- curses cur;
- cursor::set_invisible();
-
- window win_root(root);
- win_root.print(1, 1, "Press any key to continue...");
-
- coordinate coord(2, 0);;
- window win1(10, 30, coord);
- window win2(10, 30, coord.displace(3, 6));
-
- win1.print(1, 1, "pwindow 1");
- win2.print(1, 1, "pwindow 2");
-
- pwindow pwindow1(win1);
- pwindow pwindow2(win2);
-
- cur.pause();
-
- pwindow1.hide();
- win2.print(2, 1, "pwindow 1 hidden");
- cur.pause();
-
- pwindow1.show();
- pwindow1.on_bottom();
- win2.print(3, 1, "pwindow 1 back");
- cur.pause();
-
- win1.print(2, 1, "Some pwindow 1 text");
- cur.pause();
-
- pwindow1.on_top();
- win1.print(3, 1, "pwindow 2 is on bottom");
- cur.pause();
-
- win1.print(4, 1, "Moved pwindow 2 to 10-10");
- pwindow2.move(10,10);
- cur.pause();
-
- return 0;
-}
-
diff --git a/ycurses/src/examples/example3.h b/ycurses/src/examples/example3.h
deleted file mode 100644
index 80f1575..0000000
--- a/ycurses/src/examples/example3.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef EXAMPLE3_H
-#define EXAMPLE3_H
-
-#include "../curses/ycurses.h"
-
-int example3();
-
-#endif
diff --git a/ycurses/src/examples/example4.cpp b/ycurses/src/examples/example4.cpp
deleted file mode 100644
index 7e0e317..0000000
--- a/ycurses/src/examples/example4.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "example4.h"
-
-int example4()
-{
- curses cur;
- cursor::set_invisible();
-
- window win_root(root);
- win_root.print(1, 1, "Class menu example...");
-
- vector<string> vec_choices;
- vec_choices.push_back("Hallo das ist asd asdas d asd asda sd asd asd a");
- vec_choices.push_back("Bdsfsdsa das d asd asd asd as das djf");
- vec_choices.push_back("s das d asd saa sdCsdfsdf");
- menu menu1(vec_choices);
-
- menu1.run();
-
- return 0;
-}
-
-
diff --git a/ycurses/src/examples/example4.h b/ycurses/src/examples/example4.h
deleted file mode 100644
index 1bf0cbb..0000000
--- a/ycurses/src/examples/example4.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef EXAMPLE4_H
-#define EXAMPLE4_H
-
-#include "../curses/ycurses.h"
-
-int example4();
-
-#endif