Author Topic: Aurel Edit  (Read 18799 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Aurel Edit
« on: April 02, 2017, 05:43:12 AM »
I
.
« Last Edit: July 10, 2020, 11:00:46 AM by Aurel »

Arnold

  • Guest
Re: Aurel Edit
« Reply #1 on: April 05, 2017, 07:11:22 AM »
Hi Aurel,

although I will concentrate on my little project, maybe I can make some proposals for your project? Of course this is only my point of view.
I created two folders for my project: project_dev and project. Folder project_dev is my sandbox, the folder project will contain the files which I will deliver.

As long as I do modifications with my code I do not use the #include "$\inc\RTL32.inc" statement. With my editor (PSPad, but Scite or Oxide will work too) it is really easy to run the code and see the bugs at once. And when I then create an executable I will see what is still missing.

E.g. when running AurelEdit.o2bas without the runtime library then SciLexer.dll is not necessary in the working folder as Oxygenbasic will find it. I also make sure that there is no other SciLexer.dll is opened. This can be checked in a Dos Box (cmd.exe) with this command:

where scilexer.dll

Running AurelEdit as an executable is another problem. But for developing the code you will not need an extra scilexer.dll.
I copied AurelEdit.o2bas and awinh.inc into a folder AurelEdit and tried to restore the missing images (not sure if I got the right ones). I would like to suggest to add a routine like this for missing images:

Code: OxygenBasic
  1. sub missing(sys id, string name)
  2.    if not id then mbox name " not found"
  3. end sub
  4.  
  5. '--------------------------------------
  6. 'loadbmp
  7. '##################################################
  8. INT bmpB0,bmpB1,bmpB2,bmpB3,bmpB4,bmpB5,bmpB6,bmpB7,bmpB8
  9. bmpB0 = LoadImage(0,"bPanel.bmp",0,80,24,16) : missing(bmpB0, "bPanel.bmp")
  10. bmpB1 = LoadImage(0,"data/rcImg.bmp",0,400,300,16) : missing(bmpB1, "data/rcImg.bmp")
  11. '......................................................
  12. bmpB2 = LoadImage(0,"data/guiApp.bmp",0,24,24,16) : missing(bmpB2, "data/guiApp.bmp")
  13. bmpB3 = LoadImage(0,"data/consoleApp.bmp",0,24,24,16) : missing(bmpB3, "data/consoleApp.bmp")
  14. bmpB4 = LoadImage(0,"data/btCut.bmp",0,30,30,16) : missing(bmpB4, "data/btCut.bmp")
  15. bmpB5 = LoadImage(0,"data/btCopy.bmp",0,30,30,16) : missing(bmpB5, "data/btCopy.bmp")
  16. bmpB6 = LoadImage(0,"data/btPaste.bmp",0,30,30,16) : missing(bmpB6, "data/btPaste.bmp")
  17. bmpB7 = LoadImage(0,"data/btCompile.bmp",0,30,30,16) : missing(bmpB7, "data/btCompile.bmp")
  18. bmpB8 = LoadImage(0,"data/btRun.bmp",0,30,30,16) : missing(bmpB8, "data/btRun.bmp")
  19. '##################################################
  20.  
  21. and in about line 234:
  22.  
  23.   hImage = LoadImage(0, "rCodetb.bmp", 0, 280, 20, 24) : missing(hImage, "rCodetb.bmp")
  24.  

Do you need some images at all like btCut.bmp, btCopy.bmp etc. They could be integrated with your rcImg.bmp.

You definitively should add a menu to the application. It is not so comfortably easy as with a resource file (which you do not like) but it is possible. A menu will give you much more flexibility than only using a toolbar.

I would also leave the edit fields of the find/replace dialog blank and add labels in front of them e.g. something like this:
Code: OxygenBasic
  1. 'create single-line edit control
  2. % SS_LEFT=0
  3. % WS_GROUP=0x00020000
  4. label_1= SetStatic(fWindow, 80,32,60,25,"Enter word:",WS_VISIBLE | WS_CHILD | WS_GROUP | SS_LEFT,0,-1)
  5. fwed1 = SetEditBox(fWindow,  150,30,200,23,"",0x50004000,0x200,fwed1ID)
  6.  

This is all for now. There are already good starting points in your project and hopefully you will continue with it. This would also extend your awinh.inc.

Roland

Aurel

  • Guest
Re: Aurel Edit
« Reply #2 on: April 05, 2017, 10:50:52 AM »
Hs.
« Last Edit: July 10, 2020, 11:01:03 AM by Aurel »

Aurel

  • Guest
Re: Aurel Edit
« Reply #3 on: April 06, 2017, 02:29:26 AM »
T
« Last Edit: July 10, 2020, 11:01:18 AM by Aurel »

Aurel

  • Guest
Re: Aurel Edit
« Reply #4 on: April 06, 2017, 05:32:04 AM »
H
« Last Edit: July 10, 2020, 11:01:32 AM by Aurel »

Arnold

  • Guest
Re: Aurel Edit
« Reply #5 on: April 07, 2017, 05:26:19 AM »
Hi Aurel,

I was fighting with Scintilla's regex yesterday and lost the first round of the match miserably. But the battle is not yet over.

Maybe I can suggest two small modifications of your code:
I would at least add the extended style WS_TOOLWINDOW | WS_EX_TOPMOST for the fWindow control, I always had to search the find window when I pointed to the text of Scintilla.
For debugging the code I use a very simple but very effective tool:
#include "$/inc/console.inc"

I use printl statements for the console window. If I later comment out the include statement I will easily find the printl statements.
For messages of the application I use mbox (or with awinh.inc I can use MSGBOX)
This way I can follow all kinds of values, variables, controls, messages etc very easily. And when the app crashes I can simply close it by closing the console window. BTW if I close the app and the console window does not close, then something is wrong with my app as gxo2.exe / co2.exe do not release memory and I have to kill them with the task manager. So the console acts as a simple debugging tool for me and has many advantages.

I did this approach for the (print) messages which you added for the find replace dialog. Then I loaded a little test file, entered 'if' and 'uf' in the edit fields and pressed the Replace Button until I got the 'OK' message. Then I set the cursor to the top of the text again and tried to find 'if' again. There are finds, so something is missing. If I try other combinations of using the buttons, something is also missing.

This is not the solution of the problem (I did not explore the code), but I am convinced that the console would help you to find many such critical places very fast. Try it yourself.

Roland


.
« Last Edit: April 07, 2017, 06:09:47 AM by Arnold »

Aurel

  • Guest
Re: Aurel Edit
« Reply #6 on: April 07, 2017, 10:08:08 AM »
Y
« Last Edit: July 10, 2020, 11:01:49 AM by Aurel »

JRS

  • Guest
Re: Aurel Edit
« Reply #7 on: April 07, 2017, 01:10:46 PM »
Roland,

It might be worth prototyping your IDE using IUP first and if you still want to dabble with the Windows API and styles, use a Spy like utility to see how IUP did it.

Aurel

  • Guest
Re: Aurel Edit
« Reply #8 on: April 09, 2017, 12:55:10 AM »
H
« Last Edit: July 10, 2020, 11:02:03 AM by Aurel »

Aurel

  • Guest
Re: Aurel Edit
« Reply #9 on: April 09, 2017, 05:14:24 AM »
H
« Last Edit: July 10, 2020, 11:02:15 AM by Aurel »

Aurel

  • Guest
Re: Aurel Edit
« Reply #10 on: April 09, 2017, 07:06:03 AM »
H
« Last Edit: July 10, 2020, 11:02:29 AM by Aurel »

Aurel

  • Guest
Re: Aurel Edit
« Reply #11 on: April 09, 2017, 09:48:47 AM »
H
« Last Edit: July 10, 2020, 11:02:41 AM by Aurel »

Charles Pegge

  • Guest
Re: Aurel Edit
« Reply #12 on: April 10, 2017, 08:27:28 AM »

Hi Aurel, I'm using VBasic lexing:

Code: [Select]
     '3  cpp
     '8  vb ***
     '40 lout
     '51 powerbasic
     '75 freebasic
      sm SCI_SETLEXER, 8, 0
      include "oxykeywords.inc"
      sm SCI_SETKEYWORDS, 0, strptr OxyKeywords
      sm SCI_COLOURISE, 0, -1

Aurel

  • Guest
Re: Aurel Edit
« Reply #13 on: April 10, 2017, 11:41:12 AM »
sm SCI_SETKEYWORDS, 0, strptr OxyKeywords
      sm SCI_COLOURISE, 0, -1

ahh i see you use  SCI_COLOURISE,
i dont us it in my version but u will try  :)

Aurel

  • Guest
Re: Aurel Edit
« Reply #14 on: April 11, 2017, 08:57:09 AM »
Hi Charles
I have tried your way but nothing .
I only get string and comment colored ..what a heck is with this version >:(

Ok .Charles
Do you can show me where is this all code for scintilla placed ?
In OxIde or somewhere else?
thnx