March 29, 2024, 01:44:40 AM

News:

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


Andy's editor Q & A

Started by Andy, November 08, 2020, 03:40:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

I'm releasing the next beta version of my editor today.

And I think a Q & A post would keep the beta version post nice and clean.

So please, if you have any questions / observations etc, please post them here.

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

Brian

Hi, Andy,

Well, it compiled OK (rather than using the supplied exe), but when it opens it shows the active file as DemoFile.iwb, but doesn't show the program's text. Even when opening it myself, I don't see anything

I also quickly maximised the window, and noticed that the controls don't resize. Is that something you are still working on?

Brian

Andy

November 08, 2020, 05:49:59 AM #2 Last Edit: November 08, 2020, 06:07:43 AM by Andy
Brian,

I made an amendment to the zip file - you were too quick for me! Try downloading it again.

I have just made a new folder, downloaded it, extracted the files to the new folder and compiled it.

Everything is okay here and on Anne's laptop too.

Does the original exe file load it okay?

Attached is the screen shot.

Strange?

Close the demo file & try loading one of your own files...

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

billhsln

Strange results.  I ran the compiled version, closed all files and then closed the program.  Reopened the program and it comes up 'Untitled.iwb', now load any file and the title at the bottom stays 'Untitled.iwb' and if you open another file, the code switches in the RTF, but the name on the bottom stays 'Untitled.iwb'.  Now close the program and bring it back up and you have 'Untitled.iwb' and the other 2 programs that you loaded showing at the bottom.  I then deleted the Untitled and close the program and reopen and it looks fine.

I did this 3 times and it is repeatable.

Bill
When all else fails, get a bigger hammer.

Andy

November 08, 2020, 08:22:11 PM #4 Last Edit: November 08, 2020, 08:27:07 PM by Andy
Bill,

Thanks, that's bug number 1 - logged.

Seems it doesn't like going down to zero files.

Attached is a screen shot for a manual fix when you get the problem.

You have to manually edit it's start up file (xeditor4.ini)

1. Close the editor program.

2. Edit the xeditor4.ini (found in the Res folder)

3. Type in one full path to an IWB file on your machine.

4. Save the file & close it.

5, Restart the program.

For now, we need to keep to at least one file open until I can fix it.

Please see attached.

Thanks for reporting it.

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

Andy

November 09, 2020, 04:28:20 AM #5 Last Edit: November 09, 2020, 04:31:58 AM by Andy
Hi,

Just to let you all know, I've fixed the bug.

I've also added a recent files option in the File menu, everything looks good.

I will test repeatedly over the next day or so, when I'm happy I will post an amendment to the Beta 2 version of the editor.

You will be presented with just one "Untitled" file on first time use, which you will be able to close, then just browse to your files.

Took another 8 hours of works but that's nothing compared to some of the other things I've had to do with my editor.

Looks good.

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

billhsln

Another little minor bug.  When you open the editor and the files don't exist, it still shows the names at the bottom with no code showing.

Bill

When all else fails, get a bigger hammer.

Andy

Can anyone test for me please?

What I need testing is this:

When you first open up the editor, it should be blank with some buttons greyed out.

Now if you browse in the "Bin" folder, you will see a copy of Brian's Age calculator IWB file.

Can you open it please (in this / my editor program) and tell me if it shows a tab at the bottom (left of screen) a tab with the name "Age calculator" in it.

I've tried here on three different machines at it works on all of them, but Bill reports differently - he says the first time he opens a file it does not show the tab.

It is possible I might have missed sending him something.

Attached is the test zip file - you don't need to compile the program - there is an exe file ready made... Andy's editor (in the "Bin" folder).

Please could you let me know if it works or not.

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

Egil

Hi Andy,

Nice work!
But am a little confused.

The first time I tried your exe Brians code appeared to load, but all I could see is what you see in pic #1 below. No scrollbars, and no filename in lower left corner. I exited the program whithout closing the file first.

The second time I started the program and tried to load Brians code, the only difference was that the up/down scrollbar appeared, but was not able to scroll the code to see the rest of the file. See pic #2.

The third time the program was started, Brians code was alreadty there, the filename was shown in lower left corner, and the scrollbars worked. I was able to scroll up and down the file. And guess it all now worked as planned.
See pic #3.


Egil
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks for taking the time Egil, nice to talk to you again!

Screenshots appreciated.

It could be something to do with the ResizeTabs routine.

The controls FileTab1 to FileTab6 are set to zero width on creation, when you load a file the tabs are resized according to the program name.

It's possible it cant work it out and the width is remaining zero - hence you won't be able to see it.

But that leaves the question, why does it work on three different machines for me?

I need to check it out.

Glad you like what you see anyway - 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.

Andy

November 11, 2020, 02:32:45 AM #10 Last Edit: November 11, 2020, 02:35:38 AM by Andy
Egil,

Any chance you could go to the LoadWindow sub, change FileTab1 to a width of 225
(Line 13729)

Then put a RETURN statement in SUB ResizeTabs

SUB ResizeTabs()
RETURN '<---- like that.

Before you do that, in the "Res" folder, please
delete AgeCalulator.pth
delete AgeCalulator.txt

And edit xeditor4.ini to one line
!0     

Exclamation plus a zero.

If you have the time...

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

Egil

November 11, 2020, 03:33:10 AM #11 Last Edit: November 11, 2020, 03:35:46 AM by Egil
Quote from: undefinedBut that leaves the question, why does it work on three different machines for me?

Andy,
There are numerous examples of Windows programs that behave different on computers set up on other language systems than the programs were compiled on. For some obscure reason Microsoft issue different versions of their DLLs with the various language setups.
This was very easy to see when I in addition to my norwegian language systems also had a laptop with american language setup. I once bought it in Vancouver, BC. Unfortunately I gave that laptop away a couple of years ago.
But usually my own software worked ok on the system it was compiled on.

Having this in mind, I recompiled your code, and when trying to run the program I discovered that now the program started as in step two in my post above. The same happened if I closed the program after first closing the loaded file. But If I just closed the program whithout closing the loaded file first, it worked as in step three above, when restarting the program.


Tried to edit the code as you suggested, but FileTab1 is set up as a constant and I was unable to find a location in your code where it is dimensioned. Wonder if I have the same version of the code you are working on? Screendump is showing the section of the code you are referring to.

I'll try to help you as much as I can, and today I have nothing better to do...


Egil

PS
When doing the other things you suggested, it all was only a mess trying to run program after after compiling.


Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil, I really need help on this one.

When I said about FileTab1 what I meant was setting the initial size & height:

CONTROL w1,@BUTTON,"",0,647,225,20,@CTEDITLEFT,FileTab1 '<-- like this

Then just putting a RETURN line straight after SUB ReSizeTabs() so it just returns without doing anything.

The program will load more correctly because each file loaded generates 2 files.

1. A .pth file
2. A .txt file.

So after making the code changes, and before compiling / running it you need to go to the sub folder "Res" and delete any .txt files, and any .pth files.

Finally, edit xeditor4.ini so there is only one line in it:

!0

An exclamation mark plus a zero and save.

That sets everything back to before you ever used it.

Thanks,
Nice to have a friend to help out.

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

Egil

Sorry Andy...

I didn't think properly. just haven't used IWB for a couple of years.

After making the changes you suggested, the filename is now shown in lower left corner, but still unable to scroll the file. But after exiting the program whithout closing loaded file, everything works as intended when the program is restarted. The loaded file is there and you can scroll up/down.

Trying to study your code, but sure will need time to understand it all.... :)


Egil
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil,

There must have been something there that I wasn't supposed to include hence the fault.

I've now put something in place so when using it for the very first time it will make sure none of these files exist, either that or it's the resizing of tabs.

Think I will remove that just in case.

In the latest release (with this bug in it) there is a help file "Code of interest".

If you want to have a look around the code (and it's a big one) this would be your starting point, otherwise you and everyone else might understandably get confused. Something that happens to me all the time I can tell you!

Thanks for your help - greatly, greatly appreciated.

Andy.
 :)

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

Andy

November 12, 2020, 05:55:33 AM #15 Last Edit: November 12, 2020, 06:00:37 AM by Andy
While I work on the initial first time use of the editor, I decided to have a break  and add in a couple of new features.

1. Control names are now coloured, a very useful visual effect.
( If colouring is too much for you, you can simply turn things back to black )

2. When you are searching controls, you can now select a control & add in other words to it to give you a fast, less typing & powerful search.

Just click on the "Find control in the file..." checkbox and it does the rest for you.

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.

billhsln

I would think that coloring the Control Names would be confusing.  Maybe doing something like an italicized font or maybe underlined?  Just to make it stand out for what it is.  Since you are coloring commands, comments and other stuff.  I would think underlined might be easier to read then italicized.

Bill
When all else fails, get a bigger hammer.

Andy

Well here goes again.

I've changed the file tabs back to a fixed size for now, and just in case, when you run this it will purge the "Res" folder of any text files.

The only text file that should be in there is "First.txt".

Please could you do three things for me:

1. Run the program, browse to any IWB file to open it.
2. Tell me if there is a tab with the file name in it at the bottom of screen.
3. What size in MB's does task manager report it is.

Testing 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.

Brian

Andy,

If you open up the editor without any previous files being open, the icons on the left don't always appear

And the scrollbar appears to jump to the bottom at times, so you can't grab it to move down the opened file

Brian

Andy

Brian,

The icons on the left only "light up" after you have opened a file.

The scroll bar won't work likewise until the editor has a file opened.

So your step 1 is to browse to an IWB and open it.

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

Brian

I understand what you are saying, but this happened: I loaded up the program, and closed two opened IWB files. I then closed the program, and re-started it. OK so far. Then I opened up an IWB file. Only three icons on the left lit up, and the scrollbar control "square" was down at the bottom

Brian

Andy

Thanks Brian.

I get what you say now.

But when you first opened it and browsed to a file did it show the tab name at the bottom?

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

Brian

Yes - just tried it again

Brian

Andy

After thinking hard on how I program, I realised that when I'm working on some new section of code & using a particular control type (that I've used before) that I'm searching around for the same code examples.

Let's take a list view control:

What things am I likely to want?

CONTROLCMD(w1,ListView,@LVDELETEALL)
CONTROLCMD(w1,ListView,@LVGETTEXT,a,0,text)
CONTROLCMD(w1,ListView,@LVSETTEXT,a,0,text) etc...

So it would be very handy and speedy to have these things ready to hand.

That's what I've done here, just click on the new "Fast code" button, select the control type and up comes a list of things concerning that control type that you might want.

You can select which lines you want, send them to the clipboard, the paste them into you code FAST.

Better still, you can amend the list yourself so you can have what ever you like in there.

See attached screen shots.

Andy.




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

Andy

November 20, 2020, 12:25:31 AM #24 Last Edit: November 20, 2020, 03:37:49 AM by Andy
Hi,

Can someone test for me please?

It's two simple tests (exe file already included).

Please unzip the attached file.

In the Bin folder, please run Andy's editor (or compile a new copy - single file compile if you wish).

When you run the program at this point, you will see the "Welcome" message, there won't be a scroll bar or any tabs. Please ignore the on screen instructions and do test 1.

Test 1.
Go to FileTest first time use.
Make sure "Don't resize tabs" is selected.
Click "Test".

When the program restarts, after running test 1, you will get the welcome message again, open one of your IWB files please.

A. Do you see a tab at the bottom of the screen with the file name there?
B. Can you scroll?



Test 2.
Please do as test one describes, but this time select "Resize tabs".
Click "Test".

When the program restarts, after running test 2 open one of your IWB files please.

A. Do you see a tab at the bottom of the screen with the file name there?
B. Can you scroll?


Tried this on as many machines as I can get my hands on my end - all looks okay.

The results would be very helpful as I'm ready to post the latest editor version with more functions & bug fixes, just need to know the first time use works now.

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