March 28, 2024, 11:56:48 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Rich edit movement

Started by Andy, April 10, 2020, 04:20:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Sorry to ask another question on rich edit control.

I'm working my way through movement on screen and I'm now looking at the down arrow key (as well as up),
what I'm trying to detect is when you are on the bottom line of the visible screen and you press the down arrow key the rich edit scrolls down 1 line.

But how do I detect it has moved down a line? rather than moving down a line on screen that doesn't cause the rich edit to scroll.

Yes I can use WM_KEYDOWN and wParam = to 40 (down arrow key pressed) but it does't tell me the rich edit has scrolled down a line.

Any help would be greatly appreciated!

Thanks,
Andy.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

aurelCB

But how do I detect it has moved down a line?

Andy
You probably need GetCursorPosition() it is just my guess
because as far as i know there is no GetLastVisibleLine ?
do i have a right?

Egil

Hi Andy,

Not sure if GETCARETPOSITION will work in your case, but guess that the API function GetCursorPos should work. Haven't used it with IWB (not yet..), but the CB declaration should be easy to convert:

TYPE POINTAPI
  DEF x:INT
  DEF y:INT
ENDTYPE

DECLARE "user32.dll",GetCursorPos(pPoint:POINTAPI),INT



Egil
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks every one for replying.

We have had a major problem with the Internet the last couple of days so not been able to reply.

Just wanted you all to know the suggestions are appreciated!

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

April 15, 2020, 03:07:50 AM #4 Last Edit: April 15, 2020, 04:20:03 AM by Andy
For those of you who might be interested in my editor and how it's coming along here is an update for you all.

I have been working hard on navigating around code plus copying sub routines / windows.

Please see attached screen shot.

I have also added in a new useful function which allows you to read in any block of code you might want to use often and don't want to keep typing it over and over again.

All of the functions are done with one single click - so it really does save time and they are easy to use.

Any one interested in having a look at it?

There is still lots of things to do / fix so this is not the end product yet by any means.

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

April 19, 2020, 03:44:53 AM #5 Last Edit: April 19, 2020, 03:47:33 AM by Andy
Thought I would share the code I have so far...

I have still lots to do / correct, but I'm slowly getting there.

Here I am mainly concentrating on jumping to subroutines / windows, and copying / moving these from the main program to / from blocks 1 to 4 or back to the main program.

Please see the Navigation and Blocks JPG files (included in the zip file) to help you along.

Please compile xeditor4.iwb as a single file (F8) option.

Think I'm slowly going crazy doing this, so any words of encouragement would be appreciated!

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

April 25, 2020, 04:02:12 AM #6 Last Edit: April 25, 2020, 04:19:02 AM by Andy
Another handy feature - jumping to SELECT's and CASE's:

Don't know about you, but I can have lots of SELECT's and CASE's which I'm constantly jumping to.

Now you can just do a "Find" for these, but I get tiered of doing this, so I've added in drop down boxes that list all your SELECT's and the CASE's each SELECT has.

It's a super fast way of moving around your code...

Anyone like this idea - it is working.

See attached screen shots.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Here is an update with the code for my editor program.

Previously I described how we can move around by selecting "SELECT's" and "CASE's"

Here I am concentrating on these that are in sub routines such as a window's handler etc.


How to compile:

Unzip the files.
Open xeditor4.iwb in your editor.
Compile as single file - F8 option.
Ignore any warnings etc.


How to use:

When the program finishes loading go to the "Selects" drop down box (top right hand side).
Click the drop down box and select "Main".

You will see that the second drop down box underneath displays @CONTROLID - 8.
This is the SELECT @CONTROLID of the window "w1"'s handler "Main".

To the right of all this, another drop down box "Cases" will display "Cases (42)".

So to clarify what I'm saying....

We have a window called "w1".
It's handler sub routine is called "Main"
In "Main" there is a "SELECT @CONTROLID" line.
In the "Cases" drop down box we have all the "Cases" that belong to "SELECT @CONTROLID"

Now, with that in mind, if you click on the "Cases" drop down box, you will see all of them listed, and in alphabetical order - just choose one and click the green ball - the program will jump right to it.

Searching cases...

I often forget the names of cases I use, and when I want to find one I worked on days ago I just can't remember what I called it except it had the word "sub" in it.

To help out with this, under the "Cases" drop down box, there is an edit box where you can type something to search for.

Type "sub" (without the quotes) and press <Enter>.
You will see it displays (6).
Underneath the search box is yet another drop down box, click it and you will see all 6 cases that have the word "sub" in them.

Select one, and click the "Cases" green ball - the program will take you there.


Another feature added / working on - searching key words....

Don't know about you, but I can be working on say a list view control for a time - I get it working then move onto another part of the program.

Next, a few days later I can't remember how for instance I got the number of entries for a List view.
I remember it had the word "count" in it.

So to help out with this I have added a search edit box (bottom middle of the screen) and a drop down box below it.

In this edit box, type "count" (without the quotes) - the drop down box underneath now has all the key words in it that contain the word "count" - it certainly helps me!

Sorry if this is a long post to read...

The best thing to do is to download, compile, and read this in stages following the steps I have suggested.

I think you will quickly get the hang of it and hope you can see just how helpful these features are.

Still lots to do yet...

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.