From 16df185b13a664389d29ea47141ea88e6166bd84 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 19 Aug 2015 11:02:55 +0200 Subject: Moving objectio tests --- objectio/.gitignore | 8 --- objectio/Makefile | 37 ------------- objectio/calculator.icl | 108 ------------------------------------- objectio/drawingframe.icl | 126 -------------------------------------------- objectio/support_button.icl | 40 -------------- objectio/support_check.icl | 30 ----------- objectio/support_edit.icl | 44 ---------------- objectio/support_popup.icl | 37 ------------- objectio/support_radio.icl | 30 ----------- objectio/support_slider.icl | 37 ------------- objectio/support_text.icl | 30 ----------- objectio/tut2_4.icl | 25 --------- objectio/tut6_4_4.icl | 34 ------------ objectio/tut7_2_2.icl | 18 ------- 14 files changed, 604 deletions(-) delete mode 100644 objectio/.gitignore delete mode 100644 objectio/Makefile delete mode 100644 objectio/calculator.icl delete mode 100644 objectio/drawingframe.icl delete mode 100644 objectio/support_button.icl delete mode 100644 objectio/support_check.icl delete mode 100644 objectio/support_edit.icl delete mode 100644 objectio/support_popup.icl delete mode 100644 objectio/support_radio.icl delete mode 100644 objectio/support_slider.icl delete mode 100644 objectio/support_text.icl delete mode 100644 objectio/tut2_4.icl delete mode 100644 objectio/tut6_4_4.icl delete mode 100644 objectio/tut7_2_2.icl diff --git a/objectio/.gitignore b/objectio/.gitignore deleted file mode 100644 index 76cf637..0000000 --- a/objectio/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -* - -!.gitignore -!*.icl -!Makefile - -!*/ - diff --git a/objectio/Makefile b/objectio/Makefile deleted file mode 100644 index 3b0f432..0000000 --- a/objectio/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -SHELL=/bin/bash - -CLEANHOME=/opt/clean -CLEANLIB=/opt/clean/lib - -OBJECTIO=/home/camilstaps/Sources/libraries/ObjectIO/ObjectIO -OBJECTIOLINUX=$(OBJECTIO)/OS\ Linux -OBJECTIOCDIR=$(OBJECTIOLINUX)/Linux_C_12 - -CLM=clm -CLM_LIBS=$$(for l in $$(pkg-config --libs gtk+-2.0); do echo -n "-l $$l "; done)-l -lpthread -CLM_INC=-I $(OBJECTIO) -I $(OBJECTIOLINUX) -I $(CLEANLIB)/StdLib -CLM_OPTS=-tst - -ICL=$(wildcard *.icl) -EXE=$(patsubst %.icl,%,$(ICL)) - -all: $(EXE) - -$(EXE): % : %.icl | copy - $(CLM) $(CLM_LIBS) $(CLM_INC) $(CLM_OPTS) $@ -o $@ - -run: $(filter $(EXE), $(MAKECMDGOALS)) - @for i in $^; do ./$$i -h 512M; done - -rebuild: clean all - -clean: - rm -f $(EXE) - rm -rf "Clean System Files" $(EXE) - -copy: - mkdir -p "Clean System Files" - cp $(OBJECTIOCDIR)/*.o "Clean System Files" - -.PHONY: all run rebuild clean copy - diff --git a/objectio/calculator.icl b/objectio/calculator.icl deleted file mode 100644 index f8b05de..0000000 --- a/objectio/calculator.icl +++ /dev/null @@ -1,108 +0,0 @@ -module calculator - -// ******************************************************************************** -// Clean example program. -// -// This program creates a dialog with a simple calculator -// ******************************************************************************** - -import StdEnv, StdIO - -:: Calculator :== History -:: History :== [Entry] -:: Entry = Cmd Command | N Real | Invalid -:: Command = Add | Sub | Mul | Div - -calc :: History -> History -calc [] = [N 0.0] -calc [Cmd c:es] = [Cmd c:es] -calc [N b:[Cmd c:[N a:es]]] = [apply a c b : es] -where - apply :: Real Command Real -> Entry - apply a Add b = N (a + b) - apply a Sub b = N (a - b) - apply a Mul b = N (a * b) - apply _ Div 0.0 = Invalid - apply a Div b = N (a / b) -calc h = h - -instance zero History where zero = [N 0.0] - -instance toString History -where - toString [] = "0" - toString [N n:h] - | toReal (toInt n) == n = toString (toInt n) - | otherwise = toString n - toString [Invalid:h] = "C" - toString [Cmd Add:h] = toString h +++ "+" - toString [Cmd Sub:h] = toString h +++ "-" - toString [Cmd Mul:h] = toString h +++ "*" - toString [Cmd Div:h] = toString h +++ "/" - -Start :: *World -> *World -Start world -# (ids, world) = openIds 17 world -# id_add = ids!!10 -# id_sub = ids!!11 -# id_mul = ids!!12 -# id_div = ids!!13 -# id_clr = ids!!14 -# id_eq = ids!!15 -# id_res = ids!!16 -# but_numbers = [ButtonControl ("&" +++ toString i) [ControlId (ids!!i), ControlFunction (func_num i id_res), buttonwidth] \\ i <- [0..9]] -# but_add = ButtonControl "&+" [ControlId id_add, ControlFunction (func_add id_res), buttonwidth] -# but_sub = ButtonControl "&-" [ControlId id_sub, ControlFunction (func_sub id_res), buttonwidth] -# but_mul = ButtonControl "&*" [ControlId id_mul, ControlFunction (func_mul id_res), buttonwidth] -# but_div = ButtonControl "&/" [ControlId id_div, ControlFunction (func_div id_res), buttonwidth] -# but_clr = ButtonControl "&C" [ControlId id_clr, ControlFunction (func_clr id_res), buttonwidth] -# but_eq = ButtonControl "&=" [ControlId id_eq, ControlFunction (func_eq id_res), buttonwidth] -# text_res = TextControl "0" [ControlId id_res, ControlWidth (PixelWidth 200)] -# controls = text_res :+: LayoutControl (ListLS [ - LayoutControl (ListLS [but_numbers!!7, but_numbers!!8, but_numbers!!9, but_add]) [ControlPos (Left, zero)], - LayoutControl (ListLS [but_numbers!!4, but_numbers!!5, but_numbers!!6, but_sub]) [ControlPos (Left, zero)], - LayoutControl (ListLS [but_numbers!!1, but_numbers!!2, but_numbers!!3, but_mul]) [ControlPos (Left, zero)], - LayoutControl (ListLS [but_numbers!!0, but_clr, but_eq, but_div]) [ControlPos (Left, zero)] - ]) [ControlHMargin 0 0, ControlVMargin 0 0, ControlPos (Left, zero)] -# dialog = Dialog "Calculator" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog zero dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - buttonwidth = ControlWidth (ContentWidth "+") - - func_num :: Int Id (History, PSt .l) -> (History, PSt .l) - func_num n textid (h, pst) = (new_h n h, appPIO (setControlText textid (toString (new_h n h))) pst) - where - new_h n [] = [N (toReal n)] - new_h n [N m:h] = [N (10.0 * m + toReal n) : h] - new_h n h = [N (toReal n) : h] - - add_cmd :: History Command -> History - add_cmd [] _ = [] - add_cmd [Invalid : h] _ = [Invalid : h] - add_cmd [Cmd _ : h] c = [Cmd c : h] - add_cmd h c = [Cmd c : calc h] - - func_add :: Id (History, PSt .l) -> (History, PSt .l) - func_add textid (h, pst) = let new_h = add_cmd h Add in (new_h, appPIO (setControlText textid (toString new_h)) pst) - - func_sub :: Id (History, PSt .l) -> (History, PSt .l) - func_sub textid (h, pst) = let new_h = add_cmd h Sub in (new_h, appPIO (setControlText textid (toString new_h)) pst) - - func_mul :: Id (History, PSt .l) -> (History, PSt .l) - func_mul textid (h, pst) = let new_h = add_cmd h Mul in (new_h, appPIO (setControlText textid (toString new_h)) pst) - - func_div :: Id (History, PSt .l) -> (History, PSt .l) - func_div textid (h, pst) = let new_h = add_cmd h Div in (new_h, appPIO (setControlText textid (toString new_h)) pst) - - func_clr :: Id (History, PSt .l) -> (History, PSt .l) - func_clr textid ([_:h], pst) = (h, appPIO (setControlText textid (toString h)) pst) - func_clr textid st = st - - func_eq :: Id (History, PSt .l) -> (History, PSt .l) - func_eq textid (h, pst) = let new_h = calc h in (new_h, appPIO (setControlText textid (toString new_h)) pst) - diff --git a/objectio/drawingframe.icl b/objectio/drawingframe.icl deleted file mode 100644 index 00e2862..0000000 --- a/objectio/drawingframe.icl +++ /dev/null @@ -1,126 +0,0 @@ -module drawingframe - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program defines a framework in which one can test drawing functions. -// The program relies on a function, example, of type *Picture -> *Picture. -// -// Below, multiple functions `example` are given. Most of them are based on -// examples from chapter 5, Drawing, of the ObjectIO tutorial at -// http://clean.cs.ru.nl/download/supported/ObjectIO.1.2/doc/tutorial.pdf. You can -// comment out the function you want to test. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world = startIO SDI Void (snd o openWindow Void testwindow) [ProcessClose closeProcess] world - -testwindow = Window "Test Drawing (chapter 5)" NilLS [ - WindowViewSize size, - WindowClose (noLS closeProcess), - WindowLook True (\_ _ . example o (setPenColour Red) o (setPenBack Green)), - WindowViewDomain {corner1=origin,corner2=maxdomain} - ] -where - size = {w=850,h=100} - origin = {x=(-20),y=(-20)} - maxdomain = {x=origin.x+size.w,y=origin.y+size.h} - -// Rainbow -//example pict = foldr id pict [fill {corner1={x=x1 * w,y=0},corner2={x=x1 * w + w,y=h}} o (setPenColour (rainbow (toReal x1 / 5.0))) \\ x1 <- [0..160]] -//where -// w = 5 -// h = 100 -// rainbow :: a -> Colour | toReal a -// rainbow i = let i` = toReal i -// f = 0.3 in RGB { r = toInt (sin (f * i` + 0.0) * 127.0) + 128, // http://krazydad.com/tutorials/makecolors.php -// g = toInt (sin (f * i` + PI / 1.5) * 127.0) + 128, -// b = toInt (sin (f * i` + PI / 0.75) * 127.0) + 128 } - -// Points -//example = drawPointAt zero o (setPenSize 1) -//example = drawPointAt zero o (setPenSize 2) -//example = drawPointAt zero o (setPenSize 3) - -// Lines -//example = drawLine zero {x=50,y=50} o (setPenSize 1) -//example = drawLine zero {x=50,y=50} o (setPenSize 2) -//example = drawLine zero {x=50,y=50} o (setPenSize 3) - -// Crossbox (chap. 6) -//example = seq (map draw (lines {zero & corner2 = {x=810,y=60}})) -//where -// lines {corner1=a,corner2=b} = [{line_end1=p1,line_end2=p2} \\ (p1,p2) <- [(a,c),(a,d),(a,b),(b,c),(b,d),(c,d)]] -// where -// c = {b & y=a.y} -// d = {a & y=b.y} - -// Text -//example = draw "p" o (draw "o") o (drawAt zero "P") //@todo Pen is not moved -//example = drawAt zero "zero" o (drawAt {zero & y=5} "five") o (drawAt {zero & y=10} "ten") -//example = drawAt zero "zero" o (drawAt {zero & y=10} "ten") -//example = drawAt zero "zero" -//example picture -// # ((ok,font),picture) = openFont {fName="FreeMono",fStyles=[],fSize=20} picture -// | not ok = abort "Couldn't open font" -// # picture = setPenFont font picture -// = drawAt zero "zero" picture - -// Ovals -//example = drawAt zero {oval_rx=5, oval_ry=3} -//example = drawAt zero {oval_rx=5, oval_ry=5} -//example = drawAt zero {oval_rx=3, oval_ry=5} -//example = drawAt zero {oval_rx=5, oval_ry=5} o (setPenSize 1) -//example = drawAt zero {oval_rx=5, oval_ry=5} o (setPenSize 2) -//example = drawAt zero {oval_rx=5, oval_ry=5} o (setPenSize 3) -//example = fillAt zero {oval_rx=5, oval_ry=3} -//example = fillAt zero {oval_rx=5, oval_ry=5} -//example = fillAt zero {oval_rx=3, oval_ry=5} - -// Curves -curve = { curve_oval = { oval_rx=5, oval_ry=3 }, - curve_from = PI / 6.0, - curve_to = 1.5 * PI, - curve_clockwise = True } -//example = undrawAt zero curve -//example = drawAt zero { curve & curve_clockwise = False } o (setPenSize 3) -//example = fillAt zero curve -//example = fillAt {x=50,y=50} { curve & curve_clockwise = False } - -// Rectangles -//example = draw {zero & corner2={x=10,y=6}} -//example = draw {zero & corner2={x=10,y=10}} -//example = draw {zero & corner1={x=10,y=6}} -//example = draw {zero & corner2={x=10,y=10}} o (setPenSize 1) -//example = draw {zero & corner2={x=10,y=10}} o (setPenSize 2) -//example = draw {zero & corner2={x=10,y=10}} o (setPenSize 3) -//example = fill {zero & corner2={x=10,y=6}} -//example = fill {zero & corner2={x=10,y=10}} -//example = fill {zero & corner1={x=10,y=6}} - -// Boxes -//example = draw {box_w = 20, box_h = 10} o (setPenSize 3) -//example = undrawAt {x=10,y=10} {box_w = -10, box_h = -20} -//example = fill {box_w = 20, box_h = 10} -//example = unfillAt {x=10,y=10} {box_w = -10, box_h = -20} - -// Polygons -//example = undrawAt zero {polygon_shape=[{vx=8,vy=0},{vx=(-4),vy=8}]} -//example = drawAt zero {polygon_shape=[{vx=8,vy=0},{vx=0,vy=8},{vx=(-8),vy=0}]} o (setPenSize 3) -//example = fillAt zero {polygon_shape=[{vx=8,vy=0},{vx=(-8),vy=8},{vx=8,vy=0}]} -//example = unfillAt zero {polygon_shape=[{vx=8,vy=0},{vx=(-8),vy=8},{vx=8,vy=0}]} - -// Bitmaps -//@todo - -// XOR mode -//@todo - -// Hilite mode -//example = hilite {corner1={x=0,y=2},corner2={x=24,y=(-10)}} o (drawAt zero "Pop") - -// Clipping mode -//@todo - diff --git a/objectio/support_button.icl b/objectio/support_button.icl deleted file mode 100644 index 64e601b..0000000 --- a/objectio/support_button.icl +++ /dev/null @@ -1,40 +0,0 @@ -module support_button - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// ButtonControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (id, world) = openId world -# buttons = [ - ButtonControl "Function" [ControlFunction (count 1 id)], - ButtonControl "Hide" [ControlHide], - ButtonControl "Id + Width" [ControlId id, ControlWidth (PixelWidth 250)], - ButtonControl "ModsFunction" [ControlModsFunction (modf id)], - ButtonControl "Pos" [ControlPos (Left, zero)], - ButtonControl "SelectState" [ControlSelectState Able], - ButtonControl "SelectState" [ControlSelectState Unable], - ButtonControl "Tip" [ControlTip "Some tip"], - ButtonControl "Width" [ControlWidth (PixelWidth 250)] - ] -# controls = ListLS buttons -# dialog = Dialog "Support - ButtonControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - count :: Int Id (Int, PSt .l) -> (Int, PSt .l) - count dx id (count,pst=:{io}) = (count + dx, appPIO (setControlText id (toString (count+dx))) pst) - - modf :: Id Modifiers -> (Int, PSt .l) -> (Int, PSt .l) - modf id mods = \(count,pst=:{io}) . (count, appPIO (setControlText id (toString mods)) pst) - diff --git a/objectio/support_check.icl b/objectio/support_check.icl deleted file mode 100644 index 17e4199..0000000 --- a/objectio/support_check.icl +++ /dev/null @@ -1,30 +0,0 @@ -module support_check - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// CheckControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (controlid, world) = openId world -# checks = [ - CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlHide], - CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlId controlid], - CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlSelectState Able], - CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlSelectState Unable], - CheckControl [("Item &" +++ toString i, Nothing, if (isOdd i) Mark NoMark, id) \\ i <- [1..5]] (Columns 2) [ControlPos (Left, zero), ControlTip "Some tip"] - ] -# controls = ListLS checks -# dialog = Dialog "Support - CheckControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - diff --git a/objectio/support_edit.icl b/objectio/support_edit.icl deleted file mode 100644 index a8ff5d9..0000000 --- a/objectio/support_edit.icl +++ /dev/null @@ -1,44 +0,0 @@ -module support_edit - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// EditControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (id, world) = openId world -# edits = let w = PixelWidth 200 in [ - EditControl "Activate" w 3 [ControlActivate (count 1 id)], - EditControl "Deactivate" w 3 [ControlDeactivate (count -1 id)], - EditControl "Hide" w 3 [ControlHide], - EditControl "Id" (PixelWidth 500) 3 [ControlId id], - EditControl "Keyboard" w 3 [ControlKeyboard (\ks . getKeyboardStateKeyState ks <> KeyUp) Able (kbfunc id)], - EditControl "Pos" w 3 [ControlPos (Left, zero)], - EditControl "Resize" w 3 [], //todo - EditControl "SelectState" w 3 [ControlSelectState Able], - EditControl "SelectState" w 3 [ControlSelectState Unable], - EditControl "Tip" w 3 [ControlTip "Some tip"] - ] -# controls = ListLS edits -# dialog = Dialog "Support - EditControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - count :: Int Id (Int, PSt .l) -> (Int, PSt .l) - count dx id (count,pst=:{io}) = (count + dx, appPIO (setControlText id (toString (count+dx))) pst) - - modf :: Id Modifiers -> (Int, PSt .l) -> (Int, PSt .l) - modf id mods = \(count,pst=:{io}) . (count, appPIO (setControlText id (toString mods)) pst) - - kbfunc :: Id KeyboardState -> (Int, PSt .l) -> (Int, PSt .l) - kbfunc id st = \(c,pst) . (c, appPIO (setControlText id (toString st)) pst) - diff --git a/objectio/support_popup.icl b/objectio/support_popup.icl deleted file mode 100644 index 1a4d596..0000000 --- a/objectio/support_popup.icl +++ /dev/null @@ -1,37 +0,0 @@ -module support_popup - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// PopUpControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (textid, world) = openId world -# popups = let w = PixelWidth 200 in [ - PopUpControl [("Activate " +++ toString i, id) \\ i <- [1..5]] 1 [ControlActivate (count 1 textid)], // doesn't work yet - PopUpControl [("Deactivate " +++ toString i, id) \\ i <- [1..5]] 2 [ControlDeactivate (count -1 textid)], // doesn't work yet - PopUpControl [("Hide " +++ toString i, id) \\ i <- [1..5]] 1 [ControlHide], - PopUpControl [("Id " +++ toString i, id) \\ i <- [1..5]] 3 [], // todo - PopUpControl [("Pos " +++ toString i, id) \\ i <- [1..5]] 4 [ControlPos (Left, zero)], - PopUpControl [("SelectState " +++ toString i, id) \\ i <- [1..5]] 5 [ControlSelectState Able], - PopUpControl [("SelectState " +++ toString i, id) \\ i <- [1..5]] 1 [ControlSelectState Unable], - PopUpControl [("Tip " +++ toString i, id) \\ i <- [1..5]] 2 [ControlTip "Some tip"], - PopUpControl [("Width " +++ toString i, id) \\ i <- [1..5]] 3 [ControlWidth (PixelWidth 500)] - ] -# controls = ButtonControl "For callbacks" [ControlId textid] :+: ListLS popups -# dialog = Dialog "Support - PopUpControl" controls [WindowClose (noLS closeProcess), WindowViewSize {w=1000,h=500}] // because vertical space isn't reserved properly -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - count :: Int Id (Int, PSt .l) -> (Int, PSt .l) - count dx id (count,pst=:{io}) = (count + dx, appPIO (setControlText id (toString (count+dx))) pst) - diff --git a/objectio/support_radio.icl b/objectio/support_radio.icl deleted file mode 100644 index dd60858..0000000 --- a/objectio/support_radio.icl +++ /dev/null @@ -1,30 +0,0 @@ -module support_radio - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// RadioControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (controlid, world) = openId world -# radios = [ - RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 1 [ControlPos (Left, zero), ControlHide], - RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 2 [ControlPos (Left, zero), ControlId controlid], - RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 3 [ControlPos (Left, zero), ControlSelectState Able], - RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 4 [ControlPos (RightTo controlid, zero), ControlSelectState Unable], - RadioControl [("Item &" +++ toString i, Nothing, id) \\ i <- [1..5]] (Columns 2) 5 [ControlPos (Left, zero), ControlTip "Some tip"] - ] -# controls = ListLS radios -# dialog = Dialog "Support - RadioControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - diff --git a/objectio/support_slider.icl b/objectio/support_slider.icl deleted file mode 100644 index f7288f8..0000000 --- a/objectio/support_slider.icl +++ /dev/null @@ -1,37 +0,0 @@ -module support_slider - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// SliderControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (sliderid, world) = openId world -# (textid, world) = openId world -# sliders = let w = PixelWidth 300 - s = {sliderMin=0, sliderMax=100, sliderThumb=30} in [ - SliderControl Horizontal w s (updateSlider textid) [ControlPos (Left, zero), ControlHide], - SliderControl Horizontal (PixelWidth 500) s (updateSlider textid) [ControlPos (Left, zero), ControlId sliderid], - SliderControl Horizontal w s (updateSlider textid) [ControlPos (RightTo sliderid, zero)], - SliderControl Horizontal w s (updateSlider textid) [ControlPos (Left, zero)], //todo - SliderControl Horizontal w s (updateSlider textid) [ControlPos (Left, zero), ControlSelectState Able], - SliderControl Vertical w s (updateSlider textid) [ControlPos (Left, zero), ControlSelectState Unable], - SliderControl Vertical (PixelWidth 500) s (updateSlider textid) [ControlPos (Left, zero), ControlTip "Some tip"] - ] -# controls = TextControl "TextControl for callbacks" [ControlId textid] :+: ListLS sliders -# dialog = Dialog "Support - SliderControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - updateSlider :: Id SliderMove (Int, PSt .l) -> (Int, PSt .l) - updateSlider id move (n, pst) = (n, appPIO (setControlText id (toString move)) pst) - diff --git a/objectio/support_text.icl b/objectio/support_text.icl deleted file mode 100644 index 21cfc05..0000000 --- a/objectio/support_text.icl +++ /dev/null @@ -1,30 +0,0 @@ -module support_text - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program can be used to test the different ControlAttributes for a -// TextControl in a Dialog. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world -# (id, world) = openId world -# texts = [ - TextControl "Hide" [ControlHide], - TextControl "Id" [ControlId id], - TextControl "Pos" [ControlPos (Left, zero)], - TextControl "Tip" [ControlTip "Some tip"], - TextControl "Width" [ControlWidth (PixelWidth 500)] - ] -# controls = ListLS texts -# dialog = Dialog "Support - TextControl" controls [WindowClose (noLS closeProcess)] -= startIO NDI Void (initialise dialog) [] world -where - initialise dialog pst - # (error,pst) = openDialog 0 dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - diff --git a/objectio/tut2_4.icl b/objectio/tut2_4.icl deleted file mode 100644 index 3b26c0a..0000000 --- a/objectio/tut2_4.icl +++ /dev/null @@ -1,25 +0,0 @@ -module tut2_4 - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program creates a dialog that displays the "Hello world!" text. -// ******************************************************************************** - -import StdEnv, StdIO - -Start :: *World -> *World -Start world - = startIO NDI Void initialise [] world -where - initialise pst - # (error,pst) = openDialog Void hello pst - | error<>NoError = closeProcess pst - | otherwise = pst - - hello = Dialog "" - ( TextControl "Hello world!" [] - ) - [ WindowClose (noLS closeProcess) - ] - diff --git a/objectio/tut6_4_4.icl b/objectio/tut6_4_4.icl deleted file mode 100644 index 1e7f4d8..0000000 --- a/objectio/tut6_4_4.icl +++ /dev/null @@ -1,34 +0,0 @@ -module tut6_4_4 - -// ******************************************************************************** -// Clean tutorial example program. -// -// This program creates a window that displays a user selected bitmap. -// Make sure that this application has sufficient heap or extra memory. -// ******************************************************************************** - -import StdIO, StdEnv - -Start :: *World -> *World -Start world - # (maybeFile,world) = selectInputFile world - | isNothing maybeFile - = world - # bitmapfile = fromJust maybeFile - # (maybeBitmap,world) = openBitmap bitmapfile world - | isNothing maybeBitmap - = world - | otherwise - # bitmap = fromJust maybeBitmap - bitmapsize = getBitmapSize bitmap - window = Window "Bitmap" NilLS - [ WindowViewSize bitmapsize - , WindowLook True (\_ _->drawAt zero bitmap) - , WindowClose (noLS closeProcess) - ] - = startIO SDI - Void - (snd o openWindow Void window) - [ProcessClose closeProcess] - world - diff --git a/objectio/tut7_2_2.icl b/objectio/tut7_2_2.icl deleted file mode 100644 index 57d5e56..0000000 --- a/objectio/tut7_2_2.icl +++ /dev/null @@ -1,18 +0,0 @@ -module tut7_2_2 - -import StdEnv, StdIO - -Start :: *World -> *World -Start world = startIO NDI Void initialise [] world -where - initialise pst - # (error,pst) = openDialog Void dialog pst - | error <> NoError = closeProcess pst - | otherwise = pst - - dialog = Dialog "ObjectIO" controls [WindowClose (noLS closeProcess)] - - controls = ListLS [ TextControl label [ControlWidth (ContentWidth maxlabel), ControlPos (Left, zero)] :+: EditControl "" (PixelWidth 100) 1 [] \\ label <- labels] - maxlength = maxList (map size labels) - maxlabel = hd (dropWhile (\l . size l <> maxlength) labels) - labels = [ "Short label" , "Long and too verbose label" , "Medium length label" ] -- cgit v1.2.3