-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCastleMemo. Upgrade TCastleEdit, TCastleLabel. #202
base: master
Are you sure you want to change the base?
Conversation
I will take a look at it in details soon. Quick notes:
|
There are a lot of things left that were for debug. I need them for programming. But I'll delete them all later. |
Sure, that makes sense while the PR is marked as "work in progress". Thanks! And sorry for a very quick and "random" review from me 2 days ago -- I wanted to give you feedback fast about some things I noticed, and I had limited time available. Once you mark PR as ready, I usually make a longer review where I look over everything :) I forgot to mention explicitly that I like the features you do! So thank you for working on them, and I'm happy to see it happening.
I would suggest heavily to limit the features you want to include in this PR. Smaller PRs are easier to create, and easier to review, easier to discuss, and in effect usually get done and applied quicker :) For example, "Undo System" for TCastleMemo can most definitely be done as a separate PR (after this one). Unless you're already deep in the middle of implementing it now. |
It's okay, it's even good, I will immediately know my mistakes and correct them. Moreover, a memory leak in such an important function is very bad.
"Undo System" is already in development, some of the code is even on GitHub. Well, and I believe that TCastleEdit and TCastleLabel do not have such big updates to somehow separate them.
I am glad to help the Game Engine, in which I use, and other people are use, of which there will be more and more. |
Question: is TCastleEdit 'Undo System' needed? |
I would say yes. While it seems low priority for TCastleEdit, but in general sooner-or-later it will be needed by someone :), other UIs also provide undo (Ctrl+Z) in edit fields. And it is probably best to make a system that is universal (nicely fits in both TCastleEdit and TCastleMemo) from the start. |
Okey! |
New Function (very important, therefore, I am writing here): I know that "Index, Lastindex, IndexColumn, LastIndexColumn" - determine the position using how the text looks on the screen (that is, if the text on the screen is transferred to a new line (WordWrap), then this is already a new Index(Index+1)), but it will not be convenient for the programmer to choose the position of the caret. Therefore, now there is SetCaret, which determines the position of the Lines, not how it looks, but how the text is without WordWrap. And accordingly, will be GetCaret; |
The question is: how to make TCastleScrollViewManual not visible in CastleEditor? |
As for TCastleScrollViewManual:
|
"""The TCastleScrollViewManual should be created with owner set to the TCastleMemo. See TCastleCheckbox (src/ui/opengl/castlecontrols_checkbox.inc) for example how one UI control should create and "own" children, TCastleCheckbox is actually a composition of TCastleImageControl + TCastleLabel. Creating a child goes like this:
Yes, this is what was needed. Thanks! |
Sorry for taking so long. My laptop was broken. I couldn't go on TCastleMemo. |
No problem :), I'm happy you still work on it. Be sure to "rebase" your PR based on current CGE "master" code -- we did a lot of updates to CGE in the meantime, make sure your code works with them. You can follow GitHub instructions around the button "Resolve Conflicts" to do it (through web browser) or you can do it on your local system by updating your fork to follow latest CGE master. Let me know if you have some conflicts you don't know how to deal with, I can help! :) |
In my experience those instructions are really misguiding. Unless GitHub can resolve the conflict through Web UI - then it's easy and straightforward (and yet still can end up in an unwelcome/unexpected result) - it's a much better and easier way to follow some other tutorial on resolving merge conflicts. It may get a bit more tricky in merging across the forks, but if you do it "correctly" then you understand what you are doing and not get an absolutely random result, as I usually got when I was trying to follow GitHub instructions (most often ending up in deleting the fork altogether, because it ended up in a completely unfixable state). Also merging on a local drive protects your remote branch - still it's a very good idea to make a backup before merging if you are not feeling absolutely confident about what you are doing - it's very easy to destroy the branch/fork with literally no way to undo the change. Command-line it'll simply go as:
That's all. I have no idea how GitHub can make instructions for something as straightforward - as misguiding that usually it ends up in a disaster. |
@eugeneloza In this case it is a fork, and in the fork @IldusEps was working on Your instructions are for merging one branch into another within the same repo. The way to update your fork follows Something like this should work:
I fully agree that it's best to just make a backup (copy your working state) before doing it, if you don't feel certain about it :) That said, I would try first the GitHub "web editor" to resolve conflicts -- it does the job well in simple cases. And you can just "cancel" it if it is not comfortable/useful. |
Okey. I'll check everything |
Yes. You may check #254 for details. |
This PR is a bit old, and I'm not sure is it still active. In the meantime, we have done some things in CGE master related to editing -- in particular support for on-screen keyboard on Android. We also have a roadmap item summarizing the needed work around TCastleEdit and TCastleMemo (they are connected), https://castle-engine.io/roadmap#edit . So, question: is the work on this PR still active? If yes, my first advise would be to synchronize with latest CGE master. I know it will be some work, but sooner or later it will have to be done :) |
Word Wrap - property Word Wrap; True - Words are carry over when they reach the edge of the field, False - not carry;