Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

VB6 UniControls Summer Release [2008-06-19]

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
UniControls: 2008-06-19
UniText RC3 & UniList RC1: 2008-06-14


I've finally come to a point at which I'm happy enough to the results: my unicode controls as solid standalone one file user controls. LaVolpe's version of Paul Caton's SelfSub and SelfHook are being used to gain something that has been very hard before.

These controls are aimed to be basic controls, with a little twist or two. UniLabel is currently the only control that is nearly polished to it's maximum, it has one remaining issue with transparent ZOrder. Other controls are still on beta level: UniMenu needs work on easing it's usage, UniText needs polishing and adding functionality, UniCommand is an non-subclassed older version which will be replaced by subclassed one once I've resolved a few issues.

Feedback and bug reports very much appreciated!

 
Last edited:

Meeko

New member
Joined
May 17, 2001
Messages
135
Re: UniControls [2007-12-08 release]

Thanks for the controls,

I'm now trying the unitext,
but once I close the form with the unitext, it appears an "invalid procedure Call or argument" at the line

""If thunkID <> 0 Then z_scFunk.Remove "h" & thunkID"

But it's ok to execute the program!!
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: UniControls [2007-12-08 release]

Yeah, this is a known problem. I fixed it already at one point (after the release), but after messing around the code it is back in my current source. Will see if I get it fixed for the next release.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
UniControls [2007-12-15 release]

Time for the 2007-12-15 release!



What is new:
  • UniText and UniMenu are now editable: select control, right click, Edit.
  • UniLabel Caption is now presented in UTF-8 in the properties window.
  • Tons of code reordering, variables renamed etc.
  • Fixed lots of bugs (I don't keep a detailed list).
  • Rewrote UTF-8 <-> UTF-16 conversion code in UniMenu, UniLabel and UniText.
  • UniText's Text property has been hidden from the properties window to prevent accidental removal of Unicode text.

Known issues:
  • You can't use arrow keys in UniText when editing in design time.
  • UniText doesn't subclass within UniMenu, thus pressing Set is required.
  • Setting KeyAscii in KeyPress event of UniText doesn't work.
  • Focus of UniText is partially lost if window focus changes.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: UniControls [2007-12-15 release]

I have some nice news for you all: the next version of UniLabel will support Vista's themed text, meaning you can have glows, shadows and borders around text when your app runs on Vista.

At this point I already have support for glowing text and I don't think it would be too hard to add support for the rest.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: UniControls [2007-12-15 release]


Left one with solid background, right one with transparent background. So as you can see, there is a bug remaining with the transparent background. For some reason it doesn't draw properly the first time window pops up back to being visible. I'll just have to figure out why.


At this point...

New properties: Border, BorderColor, Glow, Shadow, ShadowColor, ShadowX, ShadowY, UseThemeText

New methods: SetShadow, SetShadowOffset, ThemeText


ThemeText returns True if DrawThemeTextEx can be used. It can't be used when Vista's theming is disabled and classic theme is being used instead.
 

Meeko

New member
Joined
May 17, 2001
Messages
135
Re: UniControls [2007-12-15 release]

I am not able to input chinese characters in a English OS, and some characters in the UniText1 has become "??" both in Chinese and English OS.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: UniControls [2007-12-15 release]

Could you give more details? Which version and what did you do?

Edit!
I tried to write some Chinese and it worked ok. Not that I understood anything of what I wrote, but the characters came out like they're supposed to. This on a Finnish Vista.
 
Last edited:

Meeko

New member
Joined
May 17, 2001
Messages
135
Re: UniControls [2007-12-15 release]

I just execute the sample project in my pc, which is in Chinese XP, and type chinese in UniText2.



I've also tried in an English Win 2000 PC.

 
Last edited:

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: UniControls [2007-12-15 release]

There is one possible place when characters don't go the Unicode route, so lets rule that one out: open UniText source, locate UserControl_ReadProperties and the following line:

[tt]If ssc_Subclass(UserControl.hWnd, , 1, , Ambient.UserMode) Then[/tt]

change to

[tt]If ssc_Subclass(UserControl.hWnd, , 1, , Ambient.UserMode, True) Then[/tt]

This should change the subclassing of messages of the usercontrol itself (not the textbox that has been created using API) to Unicode. This may cause other problems or not, but lets see if this has any effect for the Chinese not working.

Other than this, I don't have an idea at this point what might cause the problem.
 

Meeko

New member
Joined
May 17, 2001
Messages
135
Re: VB6 UniControls [2007-12-15 release]

I've tried modify the line but seems not working,
only some part of the Japanese (Unitext1) could now be visible in the Chinese OS.

Thanks.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: VB6 UniControls [2007-12-15 release]

See the regional settings and check if the setting for possible alternative fonts is checked. On English XP, you have to tick option "Install fonts for Far East languages" or something similar to be able to see Chinese, Japanese, Korean etc.

I can't remember what you have to do with Windows 2000 to get the fonts.
 

Herman CK

New member
Joined
Feb 16, 2008
Messages
2
Re: VB6 UniControls [2007-12-15 release]

I've taken out UniTextBox user control alone for test and found it the best of all approaches I've come across so far.

I've been able to (1) use Hand Writing Device to input Chinese characters ("Simple Chinese") and (2) paste the same from WordPad to UniTextBox alright.

One problem encountered, however. When I wanted to change the "Project Name" property of the Project, the screen flagged "Thunk hasn't been initialized". At the end, I have to re-start the computer.

The test was done on XP and Vista. I also tried it on ME, understandably it wouldn't work there, just a mention.

I've meanwhile added some properties to the user control, such as FontName selection, CharSet selection (Font's Script No.), FontSize, Bold, Italic and Underline. All worked fine. If you want me to send you my test project (so that you might save some typing), I can contact you via the mail system of Plant-Soure-Code.

Regards,
 
Last edited:

Herman CK

New member
Joined
Feb 16, 2008
Messages
2
Re: VB6 UniControls [2007-12-15 release]

Regarding the outstanding issue on your uniTextBox (you listed the issue earlier on), it seems that if you set the ForwardFocus property of the user control to True, then you will regain focus on return after losing focus to another window such as WordPad.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: VB6 UniControls [2007-12-15 release]

Focus overall is a hard issue, the default behavior involved with how user controls behave is troublesome with controls such as a textbox that involve using keys such as tab, enter and arrows. The regular user control behavior have to be cancelled in one way or another, which isn't yet done perfectly. The only "good" solutions involve using a type library, which isn't something I'm a fan of due to a requirement of an extra file while I want it all to work from one. I have ended up to capturing keys by hooking, which isn't as clean I'd want it to be...
 

LaVolpe

VB-aholic & Lovin' It
Joined
Oct 10, 2007
Messages
18,940
Re: VB6 UniControls [2007-12-15 release]

Merri, if you are still updating this project, here is an issue that you may want to examine. When textbox has focus, press F10 (activates menubar), try to use keyboard to navigate menu. Just trapping the F10 won't solve the problem though. If textbox has focus, click on the menu File, now try to use keyboard to navigate menu. I think the solution is to actually subclass the parent form and look for menu loop messages to determine when to allow right/left, up/down arrows to flow thru. Of course, subclassing the form by multiple usercontrols always leads to problems.

Anyway, I got re-interested in combining VB with API Windows and have encountered this problem. I came to your post, wondering if you had a cure for it.
 

LaVolpe

VB-aholic & Lovin' It
Joined
Oct 10, 2007
Messages
18,940
Re: VB6 UniControls [2007-12-15 release]

Merri, figured it out should you want to attack same problem. Here's what I had to do:
1) Only on wm_setfocus, start keyboard hook and also subclass the top-level window. If wm_entermenuloop or wm_contextmenu happens, release keyboard hook and restart hook on wm_exitmenuloop or after wm_contenxtmenu returns, but only if control still has focus. Note that wm_contextmenu can occur both in the top level window and the api window too.
2) On wm_killfocus, release keyboard hook always
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: VB6 UniControls [2007-12-15 release]

Ok, thanks, I probably get back into the project again some day, I'm very much of an on/off person when it comes to programming :)

Atm reading to Helsinki university entrance test.
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
Re: VB6 UniControls [2007-12-15 release]

I'm back working on the controls. However I've made a change in how I work with the project: I've given up on hooking, it just is all too messy, instead I've included an IOLEInPlaceActivate replacement module and two different TLB files to fix the issue the correct proper way.

This means the controls won't be as standalone as they used to be. In the other hand I'm aiming on having only one extra module. As a bonus though, I'm currently working on UniRich control to have an Unicode Richtextbox, and it'll need some extra class modules for usability's sake. I'm basing my work on Edanmo's excellent but IDE crashy RichEdit control, which I'll convert to SelfSub to gain stability and compatibility with my other controls.

I originally started working on my IRC client, Goldpanda, but I soon noticed three different methods for subclassing between the various components only resulted in very-very-hard-to-debug crash issues. It looks like I need to write my own WinSock replacement as well, CSocketMaster just doesn't cut it anymore, so I'll convert that to SelfSub as well (and probably do some other changes when I'm at it).


The control list is getting pretty long:
  • clsSock
  • UniCommand
  • UniLabel
  • UniList
  • UniMenu
  • UniRich
  • UniText
Just knowing that I have to rewrite tons of code doesn't sound too fun...
 

Merri

VB6, XHTML & CSS hobbyist
Joined
Oct 28, 2002
Messages
6,654
VB6 UniControls: UniText Release Candidate 3, UniList Release Candidate 1

UniText RC3 release is open for bug testing, I'd like people to check if there are any bugs or only partially done features. The control can save and load Unicode text files. UTF-7, UTF-8, UTF-16, UTF-32, big endian, little endian... all those are supported. Many codepages are also supported for loading and saving, so you can load a GB 18030 encoded text file.

UniList RC1 is also in the package. It lacks support for checkbox style but other than that it should work pretty good.

 
Last edited:
Top