import GUI
var w1, w2, w3, w4, w5, w6, w7, background_new, data_file, action : int
var text, text_temp, today, time_day : string
var file, options : int
var item : array 1 .. 12 of int
var name : array 1 .. 12 of string (20) := init ("Programs", "---", "Edit Text", "Open Text", "---", "Other", "Exit", "Background", "Text Color", "---", "--1--", "--2--")
%----------------------------------------------------------FONT ID'S--------------------------------------------------------
var FontID1 := Font.New ("Stylus BT:14:bold")
var FontID2 := Font.New ("Arial:10:bold")
var FontID3 := Font.New ("Comic Sans MS:18")
var FontID4 := Font.New ("Enviro:10")
var FontID5 := Font.New ("Comic Sans MS:10:bold") %Date Text
%--------------------------------------------------------PROCEDURE FORWARDS-------------------------------------------------
forward proc background_edit
forward proc background
forward proc exit_program
forward proc menu_load
forward proc program_list
forward proc text_edit
forward proc text_open
forward proc other
forward proc text_color
forward proc back_1
forward proc back_2
forward proc back_3
forward proc save_vars
forward proc close_w2
forward proc load_settings
forward proc close_w5
forward proc close_w4
forward proc status_bar
%-------------------------------------------------------TEXT EDIT BUTTONS---------------------------------------------------
var save_text : int := GUI.CreateButtonFull (10, 10, 0, "Save", save_vars, 0, '^S', true)
var exit_w4 : int := GUI.CreateButtonFull (150, 10, 0, "Exit", close_w4, 0, '^C', true)
GUI.Hide (save_text)
GUI.Hide (exit_w4)
%-------------------------------------------------------TEXT OPEN BUTTONS---------------------------------------------------
var exit_w5 : int := GUI.CreateButtonFull (10, 10, 0, "Exit", close_w5, 0, '^C', true)
GUI.Hide (exit_w5)
%---------------------------------------------------BACKGROUND CHANGE BUTTONS-----------------------------------------------
var new_back1 : int := GUI.CreateButtonFull (10, 250, 0, "Moon", back_1, 0, '^M', true)
var new_back2 : int := GUI.CreateButtonFull (10, 200, 0, "Desert", back_2, 0, '^D', true)
var new_back3 : int := GUI.CreateButtonFull (10, 150, 0, "Island", back_3, 0, '^I', true)
var exit_w2 : int := GUI.CreateButtonFull (10, 80, 0, "Exit", close_w2, 0, '^M', true)
GUI.Hide (new_back1)
GUI.Hide (new_back2)
GUI.Hide (new_back3)
GUI.Hide (exit_w2)
%-----------------------------------------------------SCREEN SETTINGS------------------------------------------------------
w1 := Window.Open ("title: Operating System X-Raleion M@ + Digital Images , graphics: 700, 600, position: 170,50")
setscreen ("nocursor")
process gui_run
loop
exit when GUI.ProcessEvent
end loop
end gui_run
process gui_run1
loop
exit when GUI.ProcessEvent
end loop
end gui_run1
%---------------------------------------------------OPEN VARIABLES----------------------------------------------------------
body proc load_settings
open : data_file, "runsys", get
get : data_file, background_new, text
close : data_file
end load_settings
%---------------------------------------------------BACKGROUND LAOD---------------------------------------------------------
body proc background
if background_new = 1 then
Pic.ScreenLoad ("C:/My Documents/My Pictures/moon.jpg", 0, -22, picCopy) %Load Background
elsif background_new = 2 then
Pic.ScreenLoad ("C:/My Documents/My Pictures/desert.jpg", 0, -22, picCopy) %Load Background
elsif background_new = 3 then
Pic.ScreenLoad ("C:/My Documents/My Pictures/island.jpg", 0, -22, picCopy) %Load Background
end if
end background
%--------------------------------------------------------MENU---------------------------------------------------------------
body proc menu_load
file := GUI.CreateMenu ("File")
item (1) := GUI.CreateMenuItem (name (1), program_list)
item (3) := GUI.CreateMenuItem (name (3), text_edit)
item (4) := GUI.CreateMenuItem (name (4), text_open)
item (6) := GUI.CreateMenuItem (name (6), other)
item (7) := GUI.CreateMenuItem (name (7), exit_program)
options := GUI.CreateMenu ("Options")
item (8) := GUI.CreateMenuItem (name (8), background_edit)
item (9) := GUI.CreateMenuItem (name (9), text_color)
item (11) := GUI.CreateMenuItem (name (11), other)
item (12) := GUI.CreateMenuItem (name (12), other)
end menu_load
%------------------------------------------------------PROGRAM LIST---------------------------------------------------------
body proc program_list
w3 := Window.Open ("title: X-Raleion Program List , graphics: 400, 400, position: 300,200")
Pic.ScreenLoad ("Raleion.jpg", 0, 0, picCopy) %Load Background
delay (2000)
Window.Close (w3)
end program_list
%--------------------------------------------------------TEXT EDIT----------------------------------------------------------
body proc save_vars
GUI.Hide (save_text)
GUI.Hide (exit_w4)
text := text_temp
open : data_file, "runsys", put
put : data_file, background_new, " ", text
close : data_file
Window.Close (w4)
end save_vars
body proc close_w4
GUI.Hide (save_text)
GUI.Hide (exit_w4)
Window.Close (w4)
end close_w4
body proc text_edit
fork gui_run1
w4 := Window.Open ("title: X-Raleion Edit Text , graphics: 400, 400, position: 300,200")
put " Enter Text"
GUI.Show (save_text)
GUI.Show (exit_w4)
get text_temp
end text_edit
%--------------------------------------------------------TEXT OPEN----------------------------------------------------------
body proc close_w5
GUI.Hide (exit_w5)
Window.Close (w5)
end close_w5
body proc text_open
w5 := Window.Open ("title: X-Raleion Text Open , graphics: 400, 400, position: 300,200")
open : data_file, "runsys", get
get : data_file, text
close : data_file
put text
GUI.Show (exit_w5)
end text_open
%----------------------------------------------------------OTHER------------------------------------------------------------
body proc other
w6 := Window.Open ("title: X-Raleion Excess Program Space , graphics: 400, 400, position: 300,200")
put "program list"
delay (2000)
Window.Close (w6)
end other
%-----------------------------------------------------TEXT COLOR PROGRAM----------------------------------------------------
body proc text_color
w7 := Window.Open ("title: X-Raleion Text Color Edit , graphics: 400, 400, position: 300,200")
put "text color"
delay (2000)
Window.Close (w7)
end text_color
%-----------------------------------------------------BACKGROUND CHANGE-----------------------------------------------------
body proc back_1
GUI.Hide (new_back1)
GUI.Hide (new_back2)
GUI.Hide (new_back3)
GUI.Hide (exit_w2)
background_new := 1
Window.Close (w2)
Pic.ScreenLoad ("C:/My Documents/My Pictures/moon.jpg", 0, -22, picCopy) %Load Background
View.Update
status_bar
end back_1
body proc back_2
GUI.Hide (new_back1)
GUI.Hide (new_back2)
GUI.Hide (new_back3)
GUI.Hide (exit_w2)
background_new := 2
Window.Close (w2)
Pic.ScreenLoad ("C:/My Documents/My Pictures/desert.jpg", 0, -22, picCopy) %Load Background
View.Update
status_bar
end back_2
body proc back_3
GUI.Hide (new_back1)
GUI.Hide (new_back2)
GUI.Hide (new_back3)
GUI.Hide (exit_w2)
background_new := 3
Window.Close (w2)
Pic.ScreenLoad ("C:/My Documents/My Pictures/island.jpg", 0, -22, picCopy) %Load Background
View.Update
status_bar
end back_3
body proc close_w2
GUI.Hide (new_back1)
GUI.Hide (new_back2)
GUI.Hide (new_back3)
GUI.Hide (exit_w2)
Window.Close (w2)
end close_w2
body proc background_edit
w2 := Window.Open ("title: X-Raleion Background Change , graphics: 400, 400, position: 370,250")
Font.Draw ("Select a new background", 80, 380, FontID1, black)
GUI.Show (new_back1)
GUI.Show (new_back2)
GUI.Show (new_back3)
GUI.Show (exit_w2)
end background_edit
%----------------------------------------------------------STATUS BAR--------------------------------------------------------
process time_date
loop
date (today)
time (time_day)
drawfillbox (550, 5, 698, 19, white)
Font.Draw ("" + time_day + " " + today, 550, 5, FontID5, black)
delay (1000)
end loop
end time_date
body proc status_bar
drawfillbox (0, 0, 700, 21, black)
drawfillbox (0, 1, 700, 20, white)
drawfillbox (0, 22, 700, 23, white)
drawfillbox (541, 1, 541, 20, black)
drawfillbox (699,1, 700, 20, black)
drawfillbox (0, 1, 0, 20, black)
fork time_date
end status_bar
%---------------------------------------------------------EXIT PROGRAM------------------------------------------------------
body proc exit_program
open : data_file, "runsys", put
put : data_file, background_new, " ", text
close : data_file
Window.Close (w1)
end exit_program
%--------------------------------------------------------Procedure Calls and Running----------------------------------------
fork gui_run
load_settings
background
menu_load
status_bar
now be warned.. u need to create a file first called "runsys"..or u can delete the actual loading section so it dosen't search for the file before it is screted...becasue it runs off of variables in it... |