Jump to content




WRD: text editor


10 replies to this topic

#1 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 29 December 2013 - 04:13 PM

Hello everyone. Today I decided to make a text editing program. After a couple of hours of coding, I came up with the unoptimized, auto-updating, poorly commented mess that is

WRD

I have created this program mostly for fun and because I wanted to try making a program with a graphical user interface.

Features
Spoiler

Pictures
Version 1.0
Spoiler

Version 0.95
Spoiler

Download
Spoiler

Change log
1.0 (not released yet)
  • Support for user-created themes
  • More themes
  • Partially fixed code readability
  • Added (limited) delete key functionality
  • Added the option to open from command line
  • Added scrolling to text input dialogs (so you can open files with long names :P)
Previous versions
Spoiler

How to create themes (currently not available)
Spoiler

Bugs/unintended features
Spoiler

Things that will be added
Spoiler

Thanks for reading!

Edited by InputUsername, 20 January 2014 - 08:30 AM.


#2 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 30 December 2013 - 06:53 AM

With a bit of work, this could be brilliant!

#3 Goof

  • Members
  • 751 posts

Posted 30 December 2013 - 08:40 AM

for the scrolling part,
you can make a function which draws all the important things on the screen
( eg. the header and the footer ),
then you use term.scroll(1) or whatever,
and call the function which redraws the header and footer...

example:

local termSize={term.getSize()}
local screenDATA={

	["footer"]={
		y=termSize[2];
		x=1;
		bCol=colors.lightBlue;
		tCol=colors.white
	};
}

function refreshScreen() -- the function which redraws the important things
	local pos={term.getCursorPos()}
	-- footer --
	term.setCursorPos(screenDATA["footer"].x,screenDATA["footer"].y)
	term.setBackgroundColor(screenDATA["footer"].bCol)
	term.setTextColor(screenDATA["footer"].tCol)
	term.clearLine()
	term.write("Hello")
	term.setBackgroundColor(colors.black)
	term.setTextColor(colors.yellow)
	term.setCursorPos(pos[1],pos[2])
end
function cursor_Handle() -- handle everything ( where the cursor position is and then scroll etc. )
	while true do
	refreshScreen() --- just so the "edit" program wont overlap this footer.
	position_tbl={term.getCursorPos()} -- returns position_tbl[1] = x, position_tbl[2]= y
	if position_tbl[2] >= screenDATA["footer"].y then -- heres the most important part when scrolling with custom footers and headers.
		term.scroll(1) -- first, scroll
		refreshScreen() -- then redraw 
		local pos={term.getCursorPos()} -- then set the cursor position to be sure nothing will be wrong
		term.setCursorPos(pos[1],pos[2]-1)
	end
	sleep(0) -- erm? yeah just a basic sleep function to prevent the "Too long without yielding" error
	end
end

	function func()
		shell.run("edit textEdit")
	end
	
	parallel.waitForAny(func,cursor_Handle) -- run the editor AND our created function called handler

Edited by Mikk809h, 30 December 2013 - 08:44 AM.


#4 tima_gt

  • New Members
  • 2 posts

Posted 30 December 2013 - 03:58 PM

so cool!

#5 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 31 December 2013 - 06:23 AM

View PostZudo, on 30 December 2013 - 06:53 AM, said:

With a bit of work, this could be brilliant!
Thanks! Could you tell me what 'bit of work' is needed?

View PostMikk809h, on 30 December 2013 - 08:40 AM, said:

Spoiler
I don't quite understand what you mean, but I'll try to do something with term.scroll, if that works. Thanks for the tip!

View Posttima_gt, on 30 December 2013 - 03:58 PM, said:

so cool!
Such thanks
Wow

#6 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 01 January 2014 - 09:28 PM

Looks good. The lack of capitalized first characters annoys me no end, however. While it may be intentional, it does come across as a lack of attention to detail.

#7 willwac

  • Members
  • 182 posts

Posted 18 January 2014 - 01:30 PM

It appears that wrd -t doesn't create a theme file

#8 LDShadowLord

  • Members
  • 115 posts

Posted 18 January 2014 - 04:38 PM

Suggestion: A way to change the paper size, so I can have one paper size which covers the entire page and one which is limited to give me enough room for printing on paper. It would also be cool if you could define your own paper sizes much like themes.

#9 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 18 January 2014 - 06:09 PM

View Postoeed, on 01 January 2014 - 09:28 PM, said:

Looks good. The lack of capitalized first characters annoys me no end, however. While it may be intentional, it does come across as a lack of attention to detail.
The capitalization thing was intentional, but I see why it annoys you. Will be fixed. Thanks!

View Postwillwac (NewCoolPC), on 18 January 2014 - 01:30 PM, said:

It appears that wrd -t doesn't create a theme file
That's because the version on Pastebin hasn't been updated yet. I'm still working on the update. Guess I shouldn't have added the theme part to the post. Thanks for notifying me though!

View PostLDShadowLord, on 18 January 2014 - 04:38 PM, said:

Suggestion: A way to change the paper size, so I can have one paper size which covers the entire page and one which is limited to give me enough room for printing on paper. It would also be cool if you could define your own paper sizes much like themes.
That's a good idea, I'll add an option to change paper size. Thanks!

I've had lots of tests lately, but WRD will be updated *soon*!

Edited by InputUsername, 02 February 2014 - 06:21 AM.


#10 willwac

  • Members
  • 182 posts

Posted 19 January 2014 - 08:22 AM

YAY! It's really good. Keep up the good work


#11 LDShadowLord

  • Members
  • 115 posts

Posted 30 January 2014 - 05:13 PM

OOC: Is there any ETA on a new update?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users