Jump to content
Eternal Lands Official Forums
Grum

Notepad

Recommended Posts

With regards to the notepad from hell,

a) what functionality is still missing?

B) is anyone working on it?

 

If not, I'd be willing to take another stab at it (as long as it doesn't have to be finished last week, spare time is limited).

Edited by Grum

Share this post


Link to post
Share on other sites

With regards to the notepad from hell,

a) what functionality is still missing?

I think the main missing feature is lack of scrolling.

B) is anyone working on it?

Torg did suggest he might be willing to do some work on it in this recent thread.

 

I'm probably completely misunderstanding the intended function but: I did wonder if it might be possible to simplify the notepad a bit. The use of tabs is rather limiting. Could we not simply have a list of notes. When you click on a note in the list, it is displayed and ready for editing - no tabs. A simple "back to list" type button would close the note and return to the note list.

 

One other suggestion: There is currently a limit of ten notes; the code uses a fix length array. This could be changed to use the linked list facilities and so, in practice, remove the limit. You'd need scrolling on the list then too.

Edited by bluap

Share this post


Link to post
Share on other sites

I can suggest two things as far as scrolling, both are patches that aren't up to date though :medieval:

 

https://developer.berlios.de/patch/index.ph...p;group_id=1256

[ Patch #629 ] new widget type, frame. canvas to put other widgets in

by me, put on berlios 2005-Sep-28

 

it's not directly applicable, but if you have the textarea of the notepad grow/shrink as required, and moving the cursor up/down makes the textarea move up/down in your frame, then it should all just work

this frame widget should be going into CVS in a while, and will likely be used for a URL window

 

https://developer.berlios.de/patch/index.ph...p;group_id=1256

[ Patch #481 ] Manual and automatic notepad scrolling

by crusadingknight, 2005-Jun-22

 

which is more directly related, but even older, and the textarea code has been improved a fair bit since then (see the normal typing input, being able to be edited and all)

 

since torg volunteered, it'd probably be good to talk to him... and since (IIRC) the notepad is mostly CK's work, it'd probably be good to talk to him as well, even if he's busy and can only give some info

 

there's nothing urgent about it... it's one of those things that'd be good to have done, but since the next client update is many months away, it's just a matter of having it done sufficiently before then to thoroughly test :)

 

ooh, and one other thing, I intend to look at being able to high-light sections of text at a later date (console, input, and notepad)... it probably won't affect any of the notepad development (just the textarea widget, console code, font drawing, and a copy-to-clipboard function per OS, I think), but just so you know (or if you want to work on that once you get the notepad fixed, I can give you what I've already figured out :icon13: )

Share this post


Link to post
Share on other sites

Yeah, the notepad is originally CK's work.

 

I'll poke Torg when I get a chance, see if he's still working on it, or would rather be happy to pass it on.

 

I looked at highlighting/selecting text... two years ago, but at the time decided it was too much trouble. Maybe widgets have improved in the meantime, I haven't really looked at it yet, but it would be very convenient if we were able to copy directly from the game into another window.

 

*scribbles on wish list*

Share this post


Link to post
Share on other sites

it shouldn't be too difficult. have a start and end int, both set to -1 when not in use... when your window gets a drag event, update as necessary. when using shift left/right/up/down/ctrl+up/ctrl+down/et al, update the start/end selection.

you also need a start/end int for the console itself, so you can select more than one message at once. in which case, some of your individual messages will have start of 0, and an end of (length).

 

getting the selection start/end when you do the key for copy-to-clipboard is even easier... the hardest part, I found, was drawing the characters appropriately... I did an invert-transparency thing, but that didn't work out too well... it looked kinda ugly, and if the selection went to the end of the line, the entire screen went psychedelic (this would be a bug. it looking ugly with inverted transparency more difficult)

Share this post


Link to post
Share on other sites

IIRC, the part that was causing me headaches, was mapping mouse coordinates back to character positions without starting at char 0 and adding pixels for each character.

Share this post


Link to post
Share on other sites

Grum, I'm more than happy to let you have a look at the notepad.

 

I have no idea how much time I'm going to have available in the short-term future so its really not an argument, and I haven't started to look at it yet so you are probably one up on me.

Share this post


Link to post
Share on other sites

ok, i'll take a look then.

 

As for the limit on the nr of notes: I thought the notes were dynamically allocated at some point? Ah well, will see try to remove that too.

Share this post


Link to post
Share on other sites

IIRC, the part that was causing me headaches, was mapping mouse coordinates back to character positions without starting at char 0 and adding pixels for each character.

I once wrote a line-based instead of text buffer based (such as in vi, etc.) patch for it to overcome this, and make everything work much faster, however I deleted it as Wytter didn't want a specialized widget dedicated only to the notepad. Personally, I believe that might be the better route to take to overcome some of the nastier issues (it would just required a couple new cases to deal with line endings, are cursor position fixed relative to scrolling is a snap). From what I remember, it didn't take very many LOC to make a pluggable replacement.

 

I think it's correct that tabs are useless in combination with the list, but I'd actually prefer all notes to be open in tabs, organized (Manually? Alphabetically?) so that they can be easily accessed without a multi-mode interface. Not exceptionally hard to do, and it does away with the list. Also, it might be a good idea to have focus switches autosave, and dump the save. The only option left would then be deleting a note, which might work when a tab is closed. It certainly would be a huge interface simplification.

Edited by crusadingknight

Share this post


Link to post
Share on other sites

Ok, a first version of a scrollbar for the notepad window was just checked in. Let me know if it eats your cat.

 

Things that still need to be done:

*) Scrollbar parameters are hardcoded atm, they should be configurable or at least #defined with symbolic constants

*) I'd like to fix cursor handling so that if the cursor is currently scrolled out of the viewable window, a keypress will scroll back to the cursor position, like in any other editor

*) We should probably make the notepad font size a bit smaller than default

*) it should be possible to have an unlimited number of notes, i'll have to think about how to present them. Suggestions are welcome.

 

Once all that is cleared up, and i've fixed up the unsafe sscanf's , I'll probably to start working on text selections, unless someone beats me to it.

 

EDIT: I asked for suggestions and I'm aware of the fact that ppl have already posted a number of good suggestions above, so no need to repeat those. Votes of support are welcome though, I'd like to know what would please the majority of people (well, people reading this forum, anyway).

Edited by Grum

Share this post


Link to post
Share on other sites

well, it hasn't eaten my cat yet :)

a few things: the scrollbar uses the text mouse-cursor... that looks somewhat odd

the mouse-wheel events (to scroll) work on the scrollbar and not the textinput widget... it's possibly less clean, but i think users will expect it to work there too

the scrollbar seems to be activated when there are 3 lines of text in the window, and the scrolling works so there's always 2 lines at the top, no matter how far down you scroll... I don't think you need more than one blank line at the bottom

 

as for presenting more notes, there are a couple of options I can think of.

1) keep tabs, and have a [<] and [>] button at each end of the tab-bar (this is something we can learn from web browsers). if you have a lot, that'll get bothersome, however

2) do away with the tabs. have the one window, and a list of all categories. click on one to open it, and have a close button to go back to the main window.

a list, like this, is far more suited to having a large number of notes, as you can fit a lot per page.

for bonus points, have categories of categories, and make it tree-like (I've wanted a list and a tree widget before. I think they would come in handy from time to time)

Share this post


Link to post
Share on other sites

well, it hasn't eaten my cat yet :)

Good :(

a few things: the scrollbar uses the text mouse-cursor... that looks somewhat odd

the mouse-wheel events (to scroll) work on the scrollbar and not the textinput widget... it's possibly less clean, but i think users will expect it to work there too

Both fixed

the scrollbar seems to be activated when there are 3 lines of text in the window, and the scrolling works so there's always 2 lines at the top

, no matter how far down you scroll... I don't think you need more than one blank line at the bottom

Well...

Only a single blank line at the bottom (or none at all, if no newline is given) wuld be best, but that would require me to determine how many lines the field can holf. That should be doable, so I'll look into it. However, wot the current code, I sometimes get only a single line at the end of the view area and sometime two. If i create a new note, I always seem to get two. I have a couple of exisiting notes which give me only one. I'll have to investigate what's causing that.

as for presenting more notes, there are a couple of options I can think of.

1) keep tabs, and have a [<] and [>] button at each end of the tab-bar (this is something we can learn from web browsers). if you have a lot, that'll get bothersome, however

2) do away with the tabs. have the one window, and a list of all categories. click on one to open it, and have a close button to go back to the main window.

a list, like this, is far more suited to having a large number of notes, as you can fit a lot per page.

for bonus points, have categories of categories, and make it tree-like (I've wanted a list and a tree widget before. I think they would come in handy from time to time)

A tree view is overkill, IMHO. I don't really want to implement a filesystem for a simple notepad. The single window looks attractive, but apart from simplicity, it offers no advatage over a single tab. So I'm not yet ready to rule out tabs yet. The obvious problem with tabs is currently that we have to limit the number of tabs one can open. The arrow options may improve upon that. As for them getting cumbersome: I wonder how many people would want to keep more than, say 5 notes open at the same time. What would be the point in that? Two I can imagine, three or four would be easy perhaps for cutting and pasting (once implemented), but more is not practical in any case (IMHO).

Share this post


Link to post
Share on other sites
Only a single blank line at the bottom (or none at all, if no newline is given) wuld be best, but that would require me to determine how many lines the field can holf. That should be doable, so I'll look into it.
AFAIK all letter in a font are the same height, so you should be able to get the height of a line at your text size, and divide the textarea's size by that... or did I miss something?
The arrow options may improve upon that. As for them getting cumbersome: I wonder how many people would want to keep more than, say 5 notes open at the same time. What would be the point in that? Two I can imagine, three or four would be easy perhaps for cutting and pasting (once implemented), but more is not practical in any case (IMHO).
yup, right, don't mind me, I had a braino and confused total categories with open categories :(

I do expect some people would have several open at once (especially if you can copy'n'paste canned answers to common questions on certain channels :) ), but yeah, I doubt anyone would have more than a half dozen... which then means the main problem would be categories with long names

Share this post


Link to post
Share on other sites

Ok, with the latest set of changes I've finished my todo list on the notepad. In principle an unlimited number of notes can be placed in the notepad, and everything is scrollable (including the tabs). I've also added a button in the HUD, using an icon that seemd not to be in use yet. Roja, if you want another icon, let me know.

 

I'm sure someone will have suggestions for improvement, especially in the area of layout and usability. If so, please let me know and I'll try to fix it.

 

Next up: integrating and extending Alia's selection and highlighting patch.

Share this post


Link to post
Share on other sites

Got a couple of suggestions :)

* Can you make it so it uses the windows on top setting, please :)

* Customizable font size would be nice (or is it some preset percentage of chat font?), the current one is a bit blurry for me :D

* and it would be nice if it automatically makes the last opened note active (or an option for that, in el.ini should be enough if the options window is too crowded already), some might prefer one and some the other way I think.

:)

Share this post


Link to post
Share on other sites

Got a couple of suggestions :hiya:

Thanks :)

* Can you make it so it uses the windows on top setting, please :)

Yes, that could be useful. Done.

* Customizable font size would be nice (or is it some preset percentage of chat font?), the current one is a bit blurry for me :)

Done, with one caveat: changing the font size in the game does not yet change the font size in the notes that are currently open. To do so would require some magic to keep track of the cursor position, and I'm waiting for Alia to finish his text selection patch to see if the solution he has there might be applicable for this problem. For now, simply close the note and reopen it.

* and it would be nice if it automatically makes the last opened note active (or an option for that, in el.ini should be enough if the options window is too crowded already), some might prefer one and some the other way I think.

:D

Not sure what you mean ere, but I did fix one thing that was bugging me: When you opened a note it would stay on the note selection tab. It jumps to the newly opened note now.

 

Thanks for your feedback, let me know if you have more suggestions.

Share this post


Link to post
Share on other sites

Client compiled from CVS, ~3 hours old:

 

when creating a new category, its button is created over the one of the previous line:

for example, if there are buttons for 6 categories on the main page:

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6]

 

and now create "new1, "new2", "new3", you'll see

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6] <--- [new1] is over [cat5], [new2] is over [cat6]

[new3]

 

Exiting and relogging fix the problem (all buttons go in the right position), but if you create a new category it happens again.

 

Another thing: if you create a category named "test_1" it will be created as "test", the underscore _ and anything after it is ignored

Share this post


Link to post
Share on other sites

Client compiled from CVS, ~3 hours old:

 

when creating a new category, its button is created over the one of the previous line:

for example, if there are buttons for 6 categories on the main page:

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6]

 

and now create "new1, "new2", "new3", you'll see

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6] <--- [new1] is over [cat5], [new2] is over [cat6]

[new3]

 

Exiting and relogging fix the problem (all buttons go in the right position), but if you create a new category it happens again.

 

Another thing: if you create a category named "test_1" it will be created as "test", the underscore _ and anything after it is ignored

This happened to me too, and it's been like that for a while. I'll post a screenie later on if one isn't provided (or if it's needed).

Share this post


Link to post
Share on other sites

Client compiled from CVS, ~3 hours old:

 

when creating a new category, its button is created over the one of the previous line:

for example, if there are buttons for 6 categories on the main page:

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6]

 

and now create "new1, "new2", "new3", you'll see

 

[cat1] [cat2]

[cat3] [cat4]

[cat5] [cat6] <--- [new1] is over [cat5], [new2] is over [cat6]

[new3]

 

Exiting and relogging fix the problem (all buttons go in the right position), but if you create a new category it happens again.

Strange, I thought I'd fixed that before I committed. I'll take a look tonight.

Another thing: if you create a category named "test_1" it will be created as "test", the underscore _ and anything after it is ignored

Will fix.

Share this post


Link to post
Share on other sites

I am reluctant to put up suggestions here, as I haven't seen the notebook implementation yet, but there are a couple of things which I would consider here:

  1. Notebook as an extension of the readable books.
  2. Easy to read from your notebook (select text in notebook, paste into chat buffer).

Implementing (1) would be interesting. No scrolling is involved, as there is a limit to how much text you can write on a page. Instead the 'next page' (when at end of book) gives you another blank page.

Share this post


Link to post
Share on other sites

Some key functions might be changed and added:

 

END/HOME - go to end/start of current line (not message)

CTRL - END/HOME - go to end/start of the message

PAGE UP/PAGE DOWN - move screen up/down

 

It would be also nice if text recoloring was implemented.

For example select text, press CTRL-<n>, and it will change

to color <n> (I'm not sure about shortcut).

 

If coloring in notepad will be supported I could modify copy/paste

functions so, that it will save color when transfering text between

clients.

Share this post


Link to post
Share on other sites

* Can you make it so it uses the windows on top setting, please :P

Yes, that could be useful. Done.

* Customizable font size would be nice (or is it some preset percentage of chat font?), the current one is a bit blurry for me :P

Done, with one caveat: changing the font size in the game does not yet change the font size in the notes that are currently open. To do so would require some magic to keep track of the cursor position, and I'm waiting for Alia to finish his text selection patch to see if the solution he has there might be applicable for this problem. For now, simply close the note and reopen it.

* and it would be nice if it automatically makes the last opened note active (or an option for that, in el.ini should be enough if the options window is too crowded already), some might prefer one and some the other way I think.

:o

Not sure what you mean ere, but I did fix one thing that was bugging me: When you opened a note it would stay on the note selection tab. It jumps to the newly opened note now.

 

Thanks for your feedback, let me know if you have more suggestions.

I thank you :P very nice and number 3 works how I meant my suggestion :D

 

One little thing I noticed, which seems to be a general problem (checked with 'Add buddy' text input field): Upon starting new category (or clicking 'Add buddy') the input control that pops up doesn't have keyboard focus (I hope that makes sense, what I am trying to say is: click 'new category', type note-name => note-name goes to local chat).

Share this post


Link to post
Share on other sites

One little thing I noticed, which seems to be a general problem (checked with 'Add buddy' text input field): Upon starting new category (or clicking 'Add buddy') the input control that pops up doesn't have keyboard focus (I hope that makes sense, what I am trying to say is: click 'new category', type note-name => note-name goes to local chat).

Yes, focus is based on the current mouse position, i.e. we don't have windows that "steal" keyboard focus. To do that with the current window/widget setup, I'd have to rerout all keyboard presses to the the input line on the popup window (in fact, i'm already directing all keypresses in the popup window to that line, so thing have improved, if only slightly :o).

 

Frankly, fixing this is not very high on my priority list right now. Consider it a "would be nice to have" feature :P

 

END/HOME - go to end/start of current line (not message)

CTRL - END/HOME - go to end/start of the message

PAGE UP/PAGE DOWN - move screen up/down

Yes, I agree. Will mere your patches first, then see if we can fix those.

Share this post


Link to post
Share on other sites

END/HOME - go to end/start of current line (not message)

CTRL - END/HOME - go to end/start of the message

PAGE UP/PAGE DOWN - move screen up/down

Yes, I agree. Will mere your patches first, then see if we can fix those.

BTW, this has been implemented. Please test the notepad, and let me know if everything works as expected. Suggestions for improvements are of course also very welcome.

Share this post


Link to post
Share on other sites

I figured I post this here. I have the following problem:

My notes aren't recovered, they are saved (tested by removing ~/.elc/notes.xml and making & saving new note) but when I exit game and restart and open notepad, they are gone. I get an I/O error message

I/O warning : failed to load external entity "/home/jan/.elc/notes.xml"
I/O warning : failed to load external entity "/home/jan/el-exp//notes.xml"

(the latter is the el-directory with new sound and new models, set as data_dir in el.ini)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×