4D systems Picaso uLCD 32PTU touch display library
Diff: demo.cpp
- Revision:
- 11:3ebd2263f3e9
- Parent:
- 10:b959bb206e6b
- Child:
- 12:29f5ad896382
--- a/demo.cpp Tue Sep 13 05:53:39 2016 +0000 +++ b/demo.cpp Tue Sep 13 11:37:04 2016 +0000 @@ -11,11 +11,52 @@ void PICASO_4DGL :: graphicsDemo() { //cls(); - screenOrientation(landscape); // set orientation to landscape + screenMode(landscape); // set orientation to landscape puts("This is the Graphics functions demo"); wait_ms(LONG_WAIT); cls(); /* + puts("\nLets change background color:"); + bgColor(Purple); + cls(); + wait_ms(SHORT_WAIT); + bgColor(White); + cls(); + wait_ms(SHORT_WAIT); + bgColor(Blue); + cls(); + wait_ms(SHORT_WAIT); + bgColor(Red); + cls(); + wait_ms(SHORT_WAIT); + bgColor(Aqua); + cls(); + wait_ms(SHORT_WAIT); + bgColor(Black); + cls(); + wait_ms(SHORT_WAIT); +*/ +/* + puts("\nLets change contrast"); + wait_ms(LONG_WAIT); + contrast(DISABLE); + wait_ms(SHORT_WAIT); + contrast(ENABLE); + wait_ms(SHORT_WAIT); + cls(); +*/ +/* + puts("\nLets change outline color "); + wait_ms(LONG_WAIT); + drawFilledCircle(50, 50, 20, Red); + wait_ms(SHORT_WAIT); + outlineColor(White); + wait_ms(SHORT_WAIT); + drawFilledCircle(100, 50, 20, Red); + wait_ms(LONG_WAIT); + cls(); +*/ +/* puts("\nLets change all the "); textFgColor(Purple); puts("PURPLE"); @@ -59,6 +100,9 @@ drawElipse(200, 130, 20, 10, Olive); wait_ms(SHORT_WAIT); drawFilledElipse(200, 100, 30, 20, Navy); + linePatern(10); + drawLine(200, 200, 100, 300, White); + wait_ms(LONG_WAIT); cls(); */ /* @@ -117,41 +161,87 @@ wait_ms(LONG_WAIT); cls(); */ - +/* puts("\nLets place a button:"); wait_ms(LONG_WAIT); cls(); drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); puts("\n\n\n\nDid it work?"); wait_ms(LONG_WAIT); + cls(); +*/ +/* + puts("\nNow lets change bevel width"); + wait_ms(LONG_WAIT); + if (bevelWidth(0)) { + puts("\nNo bevel"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + wait_ms(SHORT_WAIT); + cls(); + if (bevelWidth(1)) { + puts("\nbevel 1"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + wait_ms(SHORT_WAIT); + cls(); + if (bevelWidth(10)) { + puts("\nbevel 10"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + wait_ms(SHORT_WAIT); + cls(); + if (bevelWidth(16)) { + puts("\nbevel 16"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + wait_ms(SHORT_WAIT); + cls(); + if (bevelWidth(2)) { + puts("\nbevel 2"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + cls(); +*/ +/* puts("\nNow lets change bevel shadow level"); wait_ms(LONG_WAIT); - bevelShadow(0); - puts("\nNo shadow"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + if (bevelShadow(0)) { + puts("\nNo shadow"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } wait_ms(SHORT_WAIT); - bevelShadow(1); - puts("\nShadow 1"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + if (bevelShadow(1)) { + puts("\nShadow 1"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } wait_ms(SHORT_WAIT); - bevelShadow(2); - puts("\nShadow 2"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + if (bevelShadow(2)) { + puts("\nShadow 2"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } wait_ms(SHORT_WAIT); - bevelShadow(3); - puts("\nShadow 3"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + if (bevelShadow(3)) { + puts("\nShadow 3"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + wait_ms(SHORT_WAIT); + if (bevelShadow(4)) { + puts("\nShadow 4"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } wait_ms(SHORT_WAIT); - bevelShadow(4); - puts("\nShadow 4"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + if (bevelShadow(5)) { + puts("\nShadow 5"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } wait_ms(SHORT_WAIT); - bevelShadow(1); - puts("\nShadow 1"); - drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); - - //cls(); - + if (bevelShadow(1)) { + puts("\nShadow 1"); + drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); + } + cls(); +*/ /* puts("\nLets place a panel:"); wait_ms(LONG_WAIT); @@ -180,6 +270,14 @@ wait_ms(LONG_WAIT); cls(); */ + puts("\nLets get Xmax:"); + wait_ms(LONG_WAIT); + short Xmax = getGraphics(currentXMax); + puts("\nLets get Ymax:"); + wait_ms(LONG_WAIT); + short Ymax = getGraphics(currentYMax); + wait_ms(LONG_WAIT); + pc.printf("\nCurrent orientation xMax = %i, yMax = %i\n\r", Xmax, Ymax); } @@ -260,22 +358,22 @@ puts("\nOrientation:"); wait_ms(LONG_WAIT); cls(); - screenOrientation(landscape); + screenMode(landscape); puts("landscape"); wait_ms(SHORT_WAIT); cls(); - screenOrientation(landscapeRew); + screenMode(landscapeRew); puts("landscape rewersed"); wait_ms(SHORT_WAIT); cls(); - screenOrientation(portrait); + screenMode(portrait); puts("portrait"); wait_ms(SHORT_WAIT); cls(); - screenOrientation(portraitRew); + screenMode(portraitRew); puts("portrait rewersed"); wait_ms(LONG_WAIT); - screenOrientation(landscape); // set back screen to landscape + screenMode(landscape); // set back screen to landscape cls(); } @@ -286,7 +384,7 @@ void PICASO_4DGL :: textDemo() { cls(); - screenOrientation(landscape); // set screen to landscape + screenMode(landscape); // set screen to landscape puts("This is the Text functions demo"); wait_ms(LONG_WAIT); cls(); @@ -408,7 +506,7 @@ cls(); - screenOrientation(portrait); + screenMode(portrait); puts("\nText Background colors:"); wait_ms(LONG_WAIT); cls(); @@ -478,7 +576,7 @@ wait_ms(SHORT_WAIT); if (moveCursor(10, 10) == 1) puts("+"); wait_ms(SHORT_WAIT); - screenOrientation(4); + screenMode(4); if (moveCursor(50, 50) == 1) puts("+"); wait_ms(SHORT_WAIT); if (moveCursor(19, 29) == 1) puts("+"); @@ -486,7 +584,7 @@ cls(); - screenOrientation(portrait); + screenMode(portrait); puts("\nText Foreground Colors:"); wait_ms(LONG_WAIT); cls();