Text Editor, Henshu

alfcen

Well-Known Member
Licensed User
Longtime User
Hi gang,

This Open Source project is based on Erel's text editor
http://www.b4x.com/forum/showthread.php?t=824&highlight=Text+Editor
with added functionality and much room for improvement.
Henshu is Japanese for Editing.

Comment:
1. The Font and Style buttons expect a tap-and-hold (right mouse click on the desk top) to unfold a context menu.
2. The Undo function is for one event only.
3. Convert function requires selection of a number from the text.
4. NotifyIcon does not work for me with PPC 2003, but perhaps for your device.
5. Pressing (x) will place the editor to the background, Menu 'Exit' will close it.

Use or abuse.

Cheers

Robert
 

Attachments

  • henshu.zip
    97.7 KB · Views: 731

specci48

Well-Known Member
Licensed User
Longtime User
Hello alfcen,

nice improvement of Erel's text editor. :sign0098:
I like the idea calling this an open source project. What do you think is the best way to achieve this? Should everyone code for himself or would you like to act like a "project manager", combining all new features into a stable project?


specci48

... by the way, here is the first bug report:
In the context menu the entries cut and copy are mixed up :signOops:
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hallo specci48
Don't have the time to function as a project manager, just wanted to provide a platform on which others can build. A text editor is ideal for those new to Basic4ppc and in need for practicle code examples. Just a small return for what I learned in this forum.
Thanks a lot for the bug report, another reason for opening a project :)
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi gang,

Inspired by specci48's bug report, I have made a few corrections and supplements to the source. Undo still requires attention, since it remembers just a single change in the Textbox.

1. Context menu corrected, "Select All" added
2. Undo menu disabled if no change occurred
3. Loaded file name displayed as Form.Text
4. Save changes confirmation upon Exit
5. Hot keys in the Edit menu corrected (Undo and Cut)
6. Code for conversions optimized

Best luck :)
 

Attachments

  • henshu.sbp
    14.9 KB · Views: 476

specci48

Well-Known Member
Licensed User
Longtime User
OK, let's start optimizing the application... :sign0060:

I added reading %SystemRoot% from the registry on the desktop, so the connection to calculator and notepad works on the dektop for those people, who didn't install windows to c:\windows by default.

specci48
 

Attachments

  • henshu.sbp
    15 KB · Views: 398

alfcen

Well-Known Member
Licensed User
Longtime User
Very nice !
For demonstration purposes, I have added the same thing for the PPC.
 

Attachments

  • henshu.sbp
    15.1 KB · Views: 437
  • module-henshu.txt
    3 KB · Views: 551

specci48

Well-Known Member
Licensed User
Longtime User
"Find" feature added as a find bar!

specci48
 

Attachments

  • henshu.sbp
    17.4 KB · Views: 385

alfcen

Well-Known Member
Licensed User
Longtime User
Lovely addition !
I have shifted the Find panel to the top to allow SIP input and further did some layout trimming. The Find box will now show text selected prior to opening Find. The Find menu item is disabled rather than unchecked while the Find panel is visible. In the find algorithm I have merely changed WaitCursor positions.

Erel, thanks for your good piece of advice. I have added the data.
 

Attachments

  • henshu.sbp
    19 KB · Views: 432
  • module-henshu.txt
    3 KB · Views: 418

alfcen

Well-Known Member
Licensed User
Longtime User
Hi folks,

I have rolled out Henshu Ver 1.02:

1. text replace function
2. more conversions and insertions
3. registry query of default desktop browser
4. code optimizations
5. data now inserts at selected text position
6. design and layout adjustments
7. source code embraced in regions

I am targeting the editor at the Pocket PC. There is no need for another desktop editor.

There seems no end to software development. I don't know whether this is good or bad :)

Cheers
Robert
 

Attachments

  • henshu.zip
    39.4 KB · Views: 531

dzt

Active Member
Licensed User
4. NotifyIcon does not work for me with PPC 2003, but perhaps for your device.

Γεια σου (Yasou) or Hello Robert,

Please read and add latest version of NotifyIcon.DLL(http://www.b4x.com/forum/showthread.php?t=524 post #14)

I also suggest you to remove ni.New1 form mnuMinimize_Click and add it somewhere in the Sub App_Start to conserve memory. And you can do the same with ni.Add. If someone click on upper right X your editor will be invisible but with no icon. And finally remove ni.Remove as it will run by your app while exiting.



BTW1. Very nice editor. Congratulations to you and Specci48 (or Specci48K:))

BTW2. It is a good idea to add in the Version Data section the names of the needed images.
 
Last edited:

specci48

Well-Known Member
Licensed User
Longtime User
Hi all,

small upgrade on version 1.03:

1. new - ASCII support
2. new - setting "Always prompt on exit"
3. bugfix - reset form name on "New"

cheers
specci48


@alfcen
small question: What editor are you using? Because the tabbing of the source looked awful after you edited it ... :sign0013:
 

Attachments

  • henshu.sbp
    23.4 KB · Views: 409

alfcen

Well-Known Member
Licensed User
Longtime User
Yasou Dimitris,

oshirase domo arigato gozaimasu (thanks very much for the information).

With the latest NotifyIcon version I encountered this error on the desktop:

"System string object cannot be casted by System.Windows.Forms.Control"

which is strange because its the device lib.

Anyway, I spare you the original Japanese message :)

:sign0013:
You are right, ni.New1 and ni.Add really belong into App_Start.
Device memory is crucial. ;)
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hallo specci48,

Thanks a lot, looks like we are getting somewhere :)
Today, I made the following modifications:

1. Open File checks whether file is UTF-8 or ASCII and sets a utf flag.
2. Encoding (UTF-8 or ASCII) added to Form.Text upon Open and Save As.
3. ErrorLabel added to Open and Save subs to close file handle in case of error.
4. Character and word count added to the Edit menu.
5. SaveDialog Filter reduced to "*.txt" only (any others throw an error on the device, probably due to file association settings).
6. Notifyicon disabled for the time being until I get the error out of the way.

Would you mind if I removed the "Use ASCII coding by default" check box?
I feel this affects user-friendliness by overloading the editor with options.
Besides, you have kindly added Save As UTF-8 and ASCII, which, in my believe, is sufficient care of encoding.

I will submit the new source (Ver 1.04) shortly after some more testing. Please be so kind as to stand by until then. As you said it, "the one who finds a bug is entitled to keep it" :confused:

The version history is a nice gesture of yours.

I am using the IDE under Japanese o/s, but I believe the mess is due to the fact that I set my Tab Size to 1, now to 2.

Cheers
Robert
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi speeci48,

Here we go with Ver 1.04, latest modifications are:

1. Open File checks whether file is UTF-8 or ASCII and sets utf flag.
2. Encoding (UTF-8 or ASCII) added to Form.Text upon Open and Save As.
3. ErrorLabel added to Open and Save subs to close file handle in case of error.
4. Character and word count added to the Edit menu.
5. Auto-format added to the Edit menu (removes superfluous spaces and CRs).
6. SaveDialog Filter reduced to "*.txt" only (any other cause error on device).

henshu_d.zip contains the merged dlls for the desktop. Now trying the same thing for the device.
 

Attachments

  • henshu.sbp
    26 KB · Views: 473
  • module-henshu.txt
    3.1 KB · Views: 450
  • henshu_d.zip
    8.2 KB · Views: 472
Last edited:

dzt

Active Member
Licensed User
...With the latest NotifyIcon version I encountered this error on the desktop:

"System string object cannot be casted by System.Windows.Forms.Control"

which is strange because its the device lib.

Hi Rob,

Works fine with NotifyIcon. Attached is the new NotifyIcon.dll and Henshu.sbp with 2 more lines of code in your App_Start (I also added the icon Henshu.ico in your sbp file and NotifyIcon.dll as a device component).

Cheers
 

Attachments

  • henshu.zip
    9.7 KB · Views: 468

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Dimitris,

Thanks a lot for all the trouble you are taking for me.

Since ni.New1 is protected by If cPPC Then... the errors is gone :)
Also, no problems on the device, however, minimizing the screen does not show the programm icon in the device tray.

I assume that I need a WM5/6 device to fully enjoy the fruits your work.
Never mind, if it works for you it will work for others, too, and that's all I want.

Is your Japanese any better since my last posts? A good Greek red wine will help remember :sign0060:
 
D

Deleted member 103

Guest
Hi Robert,

small upgrade from me on version 1.05:

1. control "txtEdit" with Horizontal and Vertikal Scrollbar
2. Panels with Border and movable
3. Automatic orientation (Landscape) on device


Ciao,
Filippo
 

Attachments

  • henshu.zip
    19.4 KB · Views: 484
Top