March 28, 2024, 10:03:48 AM

News:

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


Color text

Started by Andy, February 03, 2020, 12:10:44 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

aurelCB

Hi Andy
Yes i see many subs used here in your include, i undrstand pointers very well because i use them in my old 
interpreter,,,AurelBasic....and yes routines in someone else includes are not easy to folow.
IWB is not that much different from EB but i recenly using another compiler so i have mix in my head of 
all that basic-s versions ,keep up the good work it is interesting.

Just one small question..as line numbers panel ,it looks to me that you use static control or i have wrong?
thanks

aurelCB

I found one interesting article on C board, adding margin looks like in scintilla control
i don't know but maybe i will try
https://cboard.cprogramming.com/windows-programming/99118-line-number-rich-edit-control.html

Andy

February 08, 2020, 02:49:02 AM #27 Last Edit: February 08, 2020, 02:53:19 AM by Andy
Yes, the line numbers on the left are statics.

It's easy in this program as you have 30 lines per screen, and I know what page number you are on.

For calculating, I start at page 0

And I use this:

sub PageDown()
 Page ++
 NewLineNo = (Page * 30)
 Down = 80
 for a = 1 to 30
  NewLineNo ++

So NewLineNo in the FOR a / NEXT a loop always has the correct corresponding line number to what text is being displayed.

And Page up goes like this:

sub PageUp()
 Page --
 if Page < 0
 Page = 0
 endif
 NewLineNo = Page * 30
 Down = 80
 for a = 1 to 30
  NewLineNo ++

Just set the the static control text "a" to a string of NewLineNo

setcontroltext(w1,a+500,ltrim$(str$(NewLineNo)))

The static controls are 501 to 531

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

aurelCB

Ahh Ok, i understand it now..
But first i will try this C example with margins in another compiler(o2) to see is it worth to spending time on that.
So far i get margins...in the same time i will made same example in EB to check both compilers.
I hope that should work..  ;)

Andy

February 08, 2020, 04:42:07 AM #29 Last Edit: February 08, 2020, 04:52:59 AM by Andy
Yes worth checking out before spending lots of time on something.
And thanks for the encouragement!

I have in the mean time got inserting lines working.
It correctly moves the text down and re-colours it, leaving a blank line ready for you to type something.

Here I have added a few new lines.

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

aurelCB

It looks very good Andy, i like syntax coloring  ;)

Andy

Thanks Aurel!

I have now got insert & delete lines working now, more or less like our editor.

Think a nice function will be to click say a button and insert certain lines such as FOR x / NEXT x etc.

OPENCONSOLE / DO:UNTIL INKEYS <> "" / CLOSECONSOLE would also be nice, I use this a lot when debugging my programs and hate having to keep typing these lines.

But before I do that, auto complete is the next function to work on.

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

billhsln

Instead of a button for FOR x / Next x and other configurations, how about a drop down box that can be modified by the user to add combinations that they would prefer to be loaded by your code?

We have FOR/NEXT, IF/THEN/ELSE/ENDIF, OPENCONSOLE/CLOSECONSOLE/DO:WHILE INKEY$<> "", ETC.

You could have:

IF x THEN y ELSE z

IF x
   y
ELSE
   z
ENDIF

Etc.

I don't know about other people, but I know I think it is a brilliant idea and a great time saver for all of us.

Thanks for all the work you are doing,
Bill


When all else fails, get a bigger hammer.

aurelCB

Translating that C code for richedit margin i get margin and line numbers but i have 
problem with EN_UPDATE notification and i get one line number more in marging 
this is how look in o2...i really don't know how to tranlate this to IWB.
if someone wish i can post translated function in basic

Andy

Bill

Thanks for the drop down box idea, thought I might not be the only one who has to keep typing the same thing time after time.

Thanks, keeps me going.

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

Andy

Took on what Bill suggested,

So I've added in (just for now a list view control - will make it a drop down box later) of all pairs of blocks...

That is FOR / NEXT,  DO / UNTIL etc...

Please see the attached screen shot.

Think this could be in a little text file so the user could easily edit it.

My code is always free and available as you all know.

Great ideas, any more any one?

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

February 10, 2020, 07:11:42 AM #36 Last Edit: February 10, 2020, 07:14:53 AM by Andy
So to recap,

With my code tools software, we already have Find & Replace (using words and in string commands).
Copy entire sub routines.
Copy windows & their handlers & the ability to rename the windows and references too.
We can remove sub routines from our code as well.

Now we can put them together with auto complete of key words (again, already done).

So any suggestions will be welcome...

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

billhsln

Only one, hopefully, very minor addition.  I prefer all my keywords to be in UPPER case, but many prefer LOWER, so how about a click to switch between upper and lower for the code that gets inserted from the new drop down?

Thanks,
Bill
When all else fails, get a bigger hammer.

Andy

Bill,

Good suggestion, I am like you on this one.

Like the key words to stand out.

I have a variable called "Ucase" for upper case.
When you set it to 1, all key words are returned as upper case, set it to zero and they are returned in lower case.

Remember my convert key words program? it's all there, just need to pull it all together in this editor now.

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

LarryMc

remember, in the IDE there's the option of Upper case , Lower case, or show them as typed : 1, 0, -1
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Or instead of a click button, how about let the user save it the way they want by editing the file, just in case, but start them out as either upper or lower.

Just another thought.

Bill
When all else fails, get a bigger hammer.

Andy

Yes great points guys,

My include file has a variable called Ucase.

1 = key words in upper case.
0 = As typed.
-1 = Lower case (just need to add this option in).

Thanks, it does help with suggestions!

Andy.
 :)

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

Andy

Just a quick update - think you will like this.

Managed now to get live scrolling with line numbers.

You can click on a sub routine / window name and the rich edit is scrolled to the exact line number the window / sub routine starts at.

You can also type in a line number - the line is also automatically scrolled to.

The text colour is coming along nicely.

And with the find / replace / copy sub / remove sub code this should be a very nice program when I have finished it for us all.

Also I can now add in bookmarks, think a description / and sub routine name would be nice as I end up with a lot of bookmarks and can never remember which one refers to what.

See attached screen shot.

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

billhsln

I really like your Subroutine and Window drop downs, also the JUMP.  Great ideas.

Bill
When all else fails, get a bigger hammer.

LarryMc

Andy
re:bookmarks
in the IDE I let the User bookmark any line and keep all the bookmarks in a scrollable control like you Next to that control I have two controls. One to allow the user to delete the currently selected bookmark and one to delete all bookmarks
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Thanks Larry, that is helpful.

I was wondering, some buttons have icons / bitmaps on them - where these royalty free?

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

Andy

Bill,

Thanks, glad you like it! there's plenty more we can add in to suite the way we program I'm sure.

Have sent you an email.

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

LarryMc

Quote from: Andy on February 15, 2020, 04:23:00 AMI was wondering, some buttons have icons / bitmaps on them - where these royalty free?

yes, I bought them

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

February 17, 2020, 04:56:50 AM #48 Last Edit: February 17, 2020, 05:13:55 AM by Andy
Thanks Larry for that.

Hecktor, please don't think I am competing with you - you are doing some great work with your editor.
I am doing something a little different just for us who use IW code - looks similar but it's not.

Here is an update for you all.

Added in Find / Replace / Copy / Rename / Remove functions.

External sub routines (not in this file) are highlighted in a coral (orange / red colour).
Internal sub routines (in this file) are in a maroon colour.
You now have page number, current edit line, page starts at line number.

If you click once on a window or sub routine, it jumps to the start line number of the window or sub routine.

If you double click on them, it jumps to the end line number.

Rome wasn't built in a day - but getting on with it.

Please see attached.

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

Andy

February 17, 2020, 07:12:16 AM #49 Last Edit: February 17, 2020, 07:14:56 AM by Andy
Hi every one,

Thought a wish list would be good.

So what what you like in an Alternative IW editor program?

Please let me know your ideas.

Please see attached screen shot.

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