PDA

Click to See Complete Forum and Search --> : VB6 UniControls Summer Release [2008-06-19]


Merri
Dec 8th, 2007, 08:30 AM
UniControls: 2008-06-19 (http://www.vbforums.com/showthread.php?p=3261531#post3261531)
UniText RC3 & UniList RC1: 2008-06-14 (http://www.vbforums.com/showthread.php?p=3250777#post3250777)


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!

http://www.vbforums.com/attachment.php?attachmentid=61010&stc=1&d=1197120598

Meeko
Dec 13th, 2007, 11:42 PM
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
Dec 14th, 2007, 12:23 AM
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
Dec 14th, 2007, 05:24 PM
Time for the 2007-12-15 release!

http://www.vbforums.com/attachment.php?attachmentid=61119&stc=1&d=1197670644

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
Dec 16th, 2007, 06:39 AM
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
Dec 16th, 2007, 11:15 AM
http://www.vbforums.com/attachment.php?attachmentid=61141&stc=1&d=1197821306
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
Dec 16th, 2007, 10:45 PM
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
Dec 16th, 2007, 11:42 PM
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.

Meeko
Dec 17th, 2007, 01:48 AM
I just execute the sample project in my pc, which is in Chinese XP, and type chinese in UniText2.

http://2.download-1.files-upload.com/50/2007/12/17/06-40/0/un_c.jpg

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

http://2.download-1.files-upload.com/50/2007/12/17/06-40/0/unicontrols.jpg

Merri
Dec 17th, 2007, 02:59 AM
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:

If ssc_Subclass(UserControl.hWnd, , 1, , Ambient.UserMode) Then

change to

If ssc_Subclass(UserControl.hWnd, , 1, , Ambient.UserMode, True) Then

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
Dec 17th, 2007, 09:57 PM
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
Dec 18th, 2007, 01:06 PM
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
Feb 16th, 2008, 02:50 PM
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,

Herman CK
Feb 17th, 2008, 12:07 PM
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
Feb 17th, 2008, 12:26 PM
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
Apr 18th, 2008, 12:11 PM
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
May 7th, 2008, 09:30 PM
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
May 8th, 2008, 01:36 AM
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
Jun 4th, 2008, 05:21 AM
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
Jun 7th, 2008, 10:40 PM
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.

http://www.vbforums.com/attachment.php?attachmentid=64656&d=1212938074

Merri
Jun 19th, 2008, 12:43 AM
2008-06-19
http://www.vbforums.com/attachment.php?attachmentid=64920&stc=1&d=1213857141

Finally a new UniControls main release. It isn't as polished as I'd like it to be, but I find it better to release often when I'm at it so here we are.

Things we have here now:
UniCaption (Unicode caption for forms)
UniCommand (command button)
UniDialog (common dialog & browseforfolder; this one needs still a lot of work)
UniLabel (the most polished of these controls)
UniList (listbox: sorting has much more power thanks to locale selection)
UniMenu (ownerdrawn menu, lots of options for colors)
UniText (textbox with wide range of Unicode support)


There is also some bonus code :)

tanjiunnyann
Oct 6th, 2008, 05:26 AM
Merri, what time do you want to update your UNICODE control again? I'm waiting your next release of the updated Unicode Control pack! ^.^

Merri
Oct 6th, 2008, 09:42 AM
I have some rewriting to do thanks to some new coding techniques that I've found since the latest release, and knowing how much time I have it may take anything from several weeks to a few months.

I'd also have to let some of the controls go, especially UniMenu, it is oldest by codebase and most likely the greatest cause of unexpected crashes (especially under IDE).

keep_touch81@yahoo.c
Feb 6th, 2009, 03:19 AM
Can u give me a sample code of simple dropdown combobox that support unicode character.

si_the_geek
Feb 6th, 2009, 09:01 AM
Welcome to VBForums :wave:

As it has not been done already, the easiest thing to do is build your own using a combination of UniText (for the part that is usually displayed), UniList (for the drop-down list) and a command button (for the drop down button).

Merri
Feb 6th, 2009, 09:08 AM
You can find Unicode combobox over at Planet Source Code. Not done by me.

udayphadkepune
Feb 7th, 2009, 10:45 AM
Can u give me a sample code of simple dropdown combobox that support unicode character.

You can add component "Microsoft forms 2.0 object Library". Then you will get new tool box. take combobox tool from that and apply it.

uday phadke

si_the_geek
Feb 7th, 2009, 10:56 AM
Welcome to VBForums :wave:

You can add it to your project, but it is illegal to distribute it (so your program will only work if it is already installed).

From Microsofts web site:
The Fm20.dll is NOT redistributable. You must have an application such as Microsoft Office 97 on the target system that installs Fm20.dll as part of its setup. (Fm20.dll is included with the OSR2 and OSR2.5 releases of Windows 95.) You can also find this file on the Visual Basic 5.0 CD under the \TOOLS\DataTool\Datatool\Msdesign folder. This will be installed only if you run the setup for the Visual Database Tools. In any case, you may not distribute the Fm20.dll as part of your setup, even if you purchase the Microsoft Office Developer Edition product.

keep_touch81@yahoo.c
Mar 6th, 2009, 07:51 AM
Hi Merri! Thanks for your reply.
Can you help me regarding your unitooltip text project. It is not working.

pinkduck
Sep 1st, 2009, 07:37 AM
The quality of Merri's code is brilliant :) Fantastic stuff.

That said, I'd like to point out that if the UniText control has the Locked property set, then the keyboard shortcut for Copy (Ctrl-C) is not passed through in the TranslateAccel method of the UniText.ctl file.

Merri
Sep 3rd, 2009, 05:44 AM
There are lots of oddities still in the code, but it is more than likely they'll never end up being fixed. Now that I'm more or less successfully entered work life I don't have the time resources I used to have, and programming wise I don't know which language I should pick up now that VB6 is slowly dying away. And I do a lot of other things besides programming (game translations, game modding, websites...).

firoz.raj
Oct 4th, 2010, 12:59 AM
Hi ,Marry why in the following code it says .Client Side Not Available???.Error is Comming at Red Line !.let me know some idea please .


Private Sub UserControl_Initialize()
m_WINNT = (Environ$("OS") = "Windows_NT")
On Error Resume Next
m_ExtenderScale = UserControl.Extender.Container.ScaleMode
If Err.Number Then
Err.Clear
m_ExtenderScale = UserControl.Parent.ScaleMode
If Err.Number Then
Err.Clear
m_ExtenderScale = vbTwips
End If
End If
On Error GoTo 0
End Sub

Merri
Oct 4th, 2010, 11:24 AM
During UserControl_Initialize the UserControl.Extender is not yet created. You have to do the call in UserControl_InitProperties (when the control is created for the first time in IDE) and UserControl_ReadProperties (all other cases).

In the recent EruLabel that I posted I think I had a better method for ScaleMode checking, but I'm not entirely sure. I did something better than I've done previously, I think.

mafommao
Jan 3rd, 2011, 02:42 AM
"VB6 is slowly dying away"
it can be raised up by real VB6 hobbyists,i believe,though many people think it's impossible,
your developments are wonderful,keep enthusiasm on them Merri!! i support u!!!
-- a VB6 hobbyist from china,don't laugh at my english,thks.

coderx
Jan 14th, 2011, 08:29 AM
How do you do, dear Marri.
I have looked your UniControl.
If I shall press the keys "қ" on UniText, that he does not show them, together he shows "?".
But if put Msgbox "" here:
Private Function Private_WndEventKeyboard(MF As MSGFILTER) As Long
Dim intShift As Integer
Dim intChar As Integer
Select Case MF.Msg
Case WM_KEYDOWN
' set the intShift parameter
intShift = Private_GetShiftMask
' set the KeyCode parameter
intChar = MF.wParam And &HFFFF&
' raise the event
RaiseEvent KeyDown(intChar, intShift)
MsgBox ""

It is сorrect shows, problem in than can be?

Merri
Jan 14th, 2011, 08:47 AM
I haven't taken a look into the source in a long time, but I think KeyDown, KeyPress & KeyUp are implemented incorrectly. They'd need a fix, but at the moment I have no interest to continue the project. A lot of these controls were written in "learn by doing" style, so there are some places where things are not done as they should've been done. I'd pretty much would like to write the controls again from nothing, using old code as reference, but I don't have the time to do that.

coderx
Jan 14th, 2011, 10:50 AM
As possible correct it? Can be I itself shall correct.

negrem
Aug 8th, 2011, 12:32 AM
Good day!
I downloaded unicontrold but they don't work on my computer
http://netlight.kz/uploads/4555.jpg

I was write on kazakh language in it, but it's writing like ???? ??? (ҚҰҮҒҢӘ)

Nightwalker83
Aug 8th, 2011, 07:18 AM
You need to install the language pack for any language you want to use.

MrSmoofy
Oct 7th, 2011, 03:45 PM
So these controls seems to be what we are looking for except I'm having an issue.

When I open the sample project I'm able to type ALT-0156 and it shows the correct character.

When I add a new form to the same project and add a UnitText box to it and try the same test it shows a black line intead of the expected unicode character.