Discussion forum about PANORAMIC language
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  
Latest topics
» What happened with the panoramic language ?
by Wed Jan 03, 2024 4:09 pm

» Hello world.
by Wed May 09, 2018 11:53 pm

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

 

  code for a text editor

Go down 
2 posters
AuthorMessage
scott93727




Number of posts : 17
Registration date : 2009-10-15

 code for a text editor  Empty
PostSubject: code for a text editor     code for a text editor  EmptySun Jun 27, 2010 11:38 am

Can anyone post the code for a text editor written in Panoramic, thanks
Back to top Go down
Gregory




Number of posts : 9
Age : 41
Localisation : South Africa
Registration date : 2010-05-12

 code for a text editor  Empty
PostSubject: Re: code for a text editor     code for a text editor  EmptySun Jun 27, 2010 9:35 pm

Here is a quick and very simple example i made that may give you a base to work
from, or mabye an idea on how to get started. Keep in mind that this is just a
basic idea and just one way to look at how to go about it. There are quite a few
more flexible commands in Panoramic that you could use to improve on this in many
ways.

Anyway :-) HTH

Code:


label SetupEditor, LoadFiles, SaveFiles, LoadSettingsMenu
label QuitEditor, NewFiles, SetFontStyle, SaveSettings

dim LoadFile$, SaveFile$

width 0, 800 : height 0, 600
caption 0, "Simple Text Editor"

main_menu 1
' The file menu...
sub_menu 2 : caption 2, "&File" : parent 2,1
sub_menu 3 : caption 3, "&New" : parent 3,2
sub_menu 4 : caption 4, "&Open" : parent 4,2
sub_menu 5 : caption 5, "&Save" : parent 5,2
sub_menu 6 : caption 6, "Exit" : parent 6,2
' The options menu...
sub_menu 7 : caption 7, "&Options" : parent 7,1
sub_menu 8 : caption 8, "Settings" : parent 8,7

gosub SetupEditor

open_dialog 10 : filter 10, "Text Files (*.txt)|*.txt"
save_dialog 11 : filter 11, "Text Files (*.txt)|*.txt"

' The settings form...
form 12 : caption 12, "Settings"
width 12, 220 : height 12, 210
button 13 : parent 13,12
list 14 : parent 14,12
alpha 15 : parent 15,12
caption 13, "Save"
width 13, 75 : height 13, 23
top 13, 145 : left 13, 60
top 14, 10 : left 14, 70
width 14, 100 : height 14, 100
font_names_add 14
top 15, 10 : left 15, 10 : caption 15, "Select font"
hide 12

' The menu functions...
on_click 3, NewFiles
on_click 4, LoadFiles
on_click 5, SaveFiles
on_click 6, QuitEditor
on_click 8, LoadSettingsMenu
on_click 13, SaveSettings
on_click 14, SetFontStyle
end

' Subs & Functons...
SetupEditor:
    memo 9
    left 9, 5 : top 9, 5
    width 9, 780 : height 9, 535
    full_space 9 : font_size 9, 10
    bar_both 9
return
LoadFiles:
    LoadFile$ = file_name$(10)
    if LoadFile$ <> "_" then file_add 9, LoadFile$
return
SaveFiles:
    SaveFile$ = file_name$(11)
    if SaveFile$ <> "_" then file_save 9, SaveFile$
return
NewFiles:
    ' Could possibly add a messagebox here to save first...
    clear 9
return
LoadSettingsMenu:
    show 12
return
SaveSettings:
    hide 12
return
SetFontStyle:
    font_name 9, item_index$(14)
return
QuitEditor:
    terminate

Back to top Go down
 
code for a text editor
Back to top 
Page 1 of 1
 Similar topics
-
» Editor close/re-open
» Text Editor
» Editor code
» Where is the code for the checkers game on the site
» PANORAMIC V 0.9.20i2 is out

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Help?-
Jump to: