# Visual Basic > Visual Basic 6 and Earlier >  The Best control for Building "Commercial" Software

## jedifuk

Hi, gurus. 

I am working on an application (inventory management), still figuring how to implement accounting (since I am not really good at accounting software).
Just discussion, what is the best control to build an application , and of course free open source.

Need input and here is my best so far I could think of :

1. Standard controls (textbox, progressbar, commandbutton) : vkusercontrolxp
2. Grid : Lynxgrid 
3. Docking and Anchoring : Autosizer (Masika Elvas)
4. Outlook/Explorer Bar : Eyedropper
5. Menubar : TDL Hookmenu 1.5
6. Image control : Lavolpealphaimage
7. MDI tabs : jcMDITabs
8. Tab Control : xTab
9. DatePicker : OsenDTPicker
10. Toolbar : MCToolBar
11. Report Control : Grapecity ActiveReport COM (still looking for free with built in report designer)
12. Combobox with MultiColumn Header : ------ (still looking)
13. Numeric Textbox (Currency) : Enhanced Textbox (not the best I found yet)
14. Flexgrid : VBFlexGrid (though I still couldn't figure out how to make hierachical with treeview node, because the commercial VSFlexgrid able to do that, and I still don't know how to export to Excel file without doing some coding and VSFlexgrid can savegrid easily)

So far this is the list for me to build really nice looking application. Might add the list and please if someone can recommend me.

Thank you

----------


## Arnoutdv

If you create commercial software then why look for free controls?

I use some controls from ComponentOne (vsFlexGrid, vsPrint, vsPDF) and from CodeJock.
The one time investment is less than 1000$.

----------


## jedifuk

well..because this is the first "commercial" and due to low budget, I intend to try with some free one first, 
And i think "free" doesn't means it couldn't create good one.

And about one time investment, is that for lifetime ? I thought you still new annual fee subscribe

----------


## Arnoutdv

No, normally you are entitled one year of free updates.
Then you can buy another year of updates, but don't have to.

ComponentOne controls are available on Grapecity: https://www.grapecity.com/componento...ex-ui-controls



> ActiveX Edition, $1195/developer, Perpetual license with a one-year subscription

----------


## ChrisE

> Hi, gurus. 
> 
> I am working on an application (inventory management), still figuring how to implement accounting (since I am not really good at accounting software).
> 
> 
> Thank you


accounting software
you know that you are legally responsible for that?
I wouldn't touch that if I were you

----------


## jedifuk

> accounting software
> you know that you are legally responsible for that?
> I wouldn't touch that if I were you


LOL... just need insight on how accounting works in terms of "database connection" (tables, queries, etc) and

----------


## jedifuk

> accounting software
> you know that you are legally responsible for that?
> I wouldn't touch that if I were you


LOL... just need insight on how accounting works in terms of "database connection" (tables, queries, etc) and "how the numbers move"

thank you

----------


## jedifuk

> No, normally you are entitled one year of free updates.
> Then you can buy another year of updates, but don't have to.
> 
> ComponentOne controls are available on Grapecity: https://www.grapecity.com/componento...ex-ui-controls


actually i am thinking develop an application , well maybe can't compete with commercial controls, but at least it can behave and works in similar way by manipulating controls....with free controls.

----------


## jedifuk

> No, normally you are entitled one year of free updates.
> Then you can buy another year of updates, but don't have to.
> 
> ComponentOne controls are available on Grapecity: https://www.grapecity.com/componento...ex-ui-controls


actually i am thinking develop an application , well maybe can't compete with commercial controls, but at least it can behave and works in similar way by manipulating controls....with free controls.

----------


## ChrisE

> LOL... just need insight on how accounting works in terms of "database connection" (tables, queries, etc) and "how the numbers move"
> 
> thank you


here a small insight of what you want to do...
well you have your costs that are Fix(every Month) and deducted from you Bank balance
a)rent
b)Staff
c)electricity
d) and so on...

then you have Income that goes into the Bank
a) sold Product 1
b) sold Product 2

then you have Tax (in Germany we have 7% and 19%)

compare costs and income then you have your Bank balance (per month and year)

perhaps try it with pen and paper first, then you'll see what fields you need in your Database tables

----------


## jedifuk

> here a small insight of what you want to do...
> well you have your costs that are Fix(every Month) and deducted from you Bank balance
> a)rent
> b)Staff
> c)electricity
> d) and so on...
> 
> then you have Income that goes into the Bank
> a) sold Product 1
> ...


nice...might do that, accounting to my mind is actually just like "moving numbers" to make it balance, but the definitions, terms ..that's what make it not easy in real world

----------


## shimalkharia

I know this thread may be dead but I really need to say it as a warning. All the pieces should fall into your accounting puzzle: "moving numbers," the definitions, and the terms. You skip one bit in accounting software and youre screwed. Just saying dude

----------


## Darkbob

> If you create commercial software then why look for free controls?
> 
> I use some controls from ComponentOne (vsFlexGrid, vsPrint, vsPDF) and from CodeJock.
> The one time investment is less than 1000$.


Hey quick question and not to hijack the thread but does vsPDF allow you to scan through a PDF, find a field name and populate that field with data?  I'm looking for a decent PDF form filler solution.

Thanks!

----------


## Arnoutdv

No I dont think the control is capable of editing/modifying existing PDF files.

----------


## Elroy

Boy, I've sure got a different opinion than many about this.  Personally, I'll never put any "purchased" controls in any of my distribution software for which I don't also get the source code to.  There's just so much garbage out there, with some of it appearing to come from "glossy, established" companies.  IMHO, it's just asking for trouble down the road.

But I'm also willing to do the hard work to make my own custom controls to do whatever I want.  One I'm particularly proud of is a custom combobox which has different colors for each item in the dropdown.  In addition, it can have a tooltip for each item in the dropdown.

In other words, when we're willing to do it ourselves, we can meet our specific needs.

As another example, I'm finishing up another project where I'm using Eduardo's latest tab-control, and I'm using his TDI (Tabbed Dialog Interface) option where the tabs have close (X) buttons on them.  However, I only want the user to be able to close the last tab.  So, I tweaked his code to have that option.  I couldn't have done that with off-the-shelf (non-source-code) software.

----------


## Karl77

> Personally, I'll never put any "purchased" controls in any of my distribution software for which I don't also get the source code to.


Besides the unavoidable ones, I only use libraries/controls with at least access to the source as well.
When a company closes or abandons the library/control and there is a fix to make, then you are lost.

I had this in early days and learned it the hard way...

----------


## ErickTaylora

Developing a commercial application for your business requires the best techniques and some kind of experience to get efficient software. I tried creating a commercial application myself and failed miserably. Now I prefer a professional approach to development control for the timely detection and prevention of risks.

If you dont have enough experience developing commercial applications, itd make more sense to contact a reputable computer vision software development company. Thus, youll be able to implement your idea most efficiently and get a top-quality app.

----------


## ntstatic

i already have an accounting system from 1997 so let me tell you what you need to do 

make the application general 
you should follow the Double entry system so if you have made a payment 

cash Credit amount
party debit amount 

sales =
client debit amount
sales a/c credit amount 

this is putting it too mildly 
then totalling them all will give you a trial balance ... grouping them in particular ways will give you Trading a/c profit and loss a/c and balance sheet 

do not rely on knowledge gained in this way 

this is the basic of accounting ... study it ... it is beautifully explained 
https://www.amazon.in/SHETH-BOOK-KEE...=books&sr=1-22

----------


## SearchingDataOnly

> Boy, I've sure got a different opinion than many about this.  Personally, I'll never put any "purchased" controls in any of my distribution software for which I don't also get the source code to.  There's just so much garbage out there, with some of it appearing to come from "glossy, established" companies.  IMHO, it's just asking for trouble down the road.
> 
> But I'm also willing to do the hard work to make my own custom controls to do whatever I want.  One I'm particularly proud of is a custom combobox which has different colors for each item in the dropdown.  In addition, it can have a tooltip for each item in the dropdown.
> 
> In other words, when we're willing to do it ourselves, we can meet our specific needs.
> 
> As another example, I'm finishing up another project where I'm using Eduardo's latest tab-control, and I'm using his TDI (Tabbed Dialog Interface) option where the tabs have close (X) buttons on them.  However, I only want the user to be able to close the last tab.  So, I tweaked his code to have that option.  I couldn't have done that with off-the-shelf (non-source-code) software.


I kind of understand your thoughts now. I've used RC3/RC5/RC6 for many years and it performs almost perfectly, without a doubt, it's the best vb6 framework in the world. It's a free software, but more mature and stable than most commercial software, and there is also free technical support.  :Smilie: 

But when I wanted to provide a core-lib for my scripting language, I needed to make a lot of changes/modifications to RC6 to meet my various quirky requirements. But this is obviously not possible, because we don't have the source code of RC6, and even if there is a minor change to be added, I need to ask Olaf to complete it. In order not to take up too much of Olaf's time, I have to develop my own core-lib from scratch, which is a difficult and long process, but it is a mountain I have to cross or the rest of the work can not be carried out.

----------


## Elroy

> i already have an accounting system from 1997 so let me tell you what you need to do 
> 
> make the application general 
> you should follow the Double entry system so if you have made a payment 
> 
> cash Credit amount
> party debit amount 
> 
> sales =
> ...


I actually started my professional programming career by writing commercial accounting applications.  Also, my undergraduate degree is in Accounting (with honors), although I never sat for the CPA, as I knew I wanted my own business and didn't actually want to practice accounting.  I wrote several accounting applications, but the most successful was a project management, budgeting, tracking, and general accounting program for architects and engineers, which sold worldwide and did quite well for me.  That was in the 80s and early 90s, all written in PDS Basic (before VB).

And that's just an early C.V. of who I am before I offer some unsolicited advice.  If I were to get back into accounting software (which I never will), I would not use the double-entry approach.  There are several reasons for this: 1) the double-entry approach was designed for pencil-and-paper accounting to allow a check of all the entries (checking individual entries with the global results on the Balance Sheet); 2) using a computer, you wouldn't actually enter the value twice, even if you did use double-entry, so the whole "balancing" idea is defeated; 3) there are much better ways to check things written to our computers than doing double-entry (such as RAID hardware and/or software); 4) if things actually do get haywire within the software's database, it becomes a nightmare to try and figure it out.

Sure, you'll never get away from the requirement of a Balance Sheet, but there's no need for double-entries in the database to get this done.  With a well-thought-out database structure, you can get it all done with single entries for all your transactions.  Just as a trivial example, there's no need to track "capital".  It's just "assets" minus "liabilities".  And this single-entry idea can be taken down to the most minute level, and computers add things up very quickly.

----------


## ntstatic

> I actually started my professional programming career by writing commercial accounting applications.  Also, my undergraduate degree is in Accounting (with honors), although I never sat for the CPA, as I knew I wanted my own business and didn't actually want to practice accounting.  I wrote several accounting applications, but the most successful was a project management, budgeting, tracking, and general accounting program for architects and engineers, which sold worldwide and did quite well for me.  That was in the 80s and early 90s, all written in PDS Basic (before VB).
> 
> And that's just an early C.V. of who I am before I offer some unsolicited advice.  If I were to get back into accounting software (which I never will), I would not use the double-entry approach.  There are several reasons for this: 1) the double-entry approach was designed for pencil-and-paper accounting to allow a check of all the entries (checking individual entries with the global results on the Balance Sheet); 2) using a computer, you wouldn't actually enter the value twice, even if you did use double-entry, so the whole "balancing" idea is defeated; 3) there are much better ways to check things written to our computers than doing double-entry (such as RAID hardware and/or software); 4) if things actually do get haywire within the software's database, it becomes a nightmare to try and figure it out.
> 
> Sure, you'll never get away from the requirement of a Balance Sheet, but there's no need for double-entries in the database to get this done.  With a well-thought-out database structure, you can get it all done with single entries for all your transactions.  Just as a trivial example, there's no need to track "capital".  It's just "assets" minus "liabilities".  And this single-entry idea can be taken down to the most minute level, and computers add things up very quickly.


glad to know your tryst with accounting software 

i did not mean to say you needed to enter two records to create a double entry system ... i mentioned the method of bookkeeping which i have found to be most efficient  the entry is made only once (in the age of computers) .. but it appears in two ledgers ... was what i meant ... the single entry system i do not think is very efficient for the kind of account we are talking about (generic, configurable) ( though i am an engineer and all i know about accounting is from the book i posted ... and even then ... i have had many discussions with various chartered accountants .. of my clients ... and none have been able to convince me ( or themselves in the end ) that there is a choice to the double entry (again entry here does not mean duplication of data )

so 
party credit 100$
purchase a/c debit 100$             would become of course

party       purchase          100
and while retriving the data would be split to get the two entries 

this is the simplest of scenearios as it becomes quite complex in systems which include inventory etc ... more so when the inventory is for manufacturing ... more so when it involves metals ... and even more if purity is involved as in jewellery  :Wink:  and we have not even considered barter in metals ...multiple metals in one piece of jewellery .. multiple studdings ... multiple labour charges etc 
not to mention local tax laws 

ive had ERPs (account, inventory, analysis) for Garments, engineering and manufacturing units etc 
but personally i think Jewellery ERP is the most complex ... more so if you are based in India

----------


## Schmidt

> ...I needed to make a lot of changes/modifications to RC6 to meet my various quirky requirements.


The RC5/6-libs are thought as an addon-framework, to solve "typical day-to-day-problems"
(from within "existing and stable languages", using COM-Helper-Objects).

Whilst your "special case" is (still):
 - "implementing a new ScriptLanguage+Parser which ends up in a decent AST".




> But this is obviously not possible, because we don't have the source code of RC6...


Hey, don't blame the tool, when you reach your own limits...  :Wink: 

Implementing a decent and fast Script-Parser, is entirely possible with VB6 alone - 
there's no "Extra-Help needed from RC6-Classes" for that task.

The only thing such an attempt will require is either:
1) understanding how to implement a "flattened Tree, based on UDTs" ... or - alternatively -
2) understanding how to "implement a HashList as a lightweight COM-Object"
...(along with a handful of other, specialized LW-COM-Objects needed for such a ScriptParser-Engine)

For the latter part, I've already posted two CodeBank-entries you could study (with full VB6-Source):
- cHashD
- and the "how-to" for "Lightweight-COM"-article

That requirement (in 2) for LightWeight-COM-Objects (instead of "normal VB6-generated COM-instances") 
is not "due to missing features in the RC6" ...
instead it is due to an "inherent problems in the VB6-runtime" 
(which -Problem1- can only create COM-instances which are at least 110Bytes large - 
and -Problem2- cannot free larger amounts of COM-Instances in a fast manner).

I kind of understand "the frustration when you get stuck with some project" - 
but you seem to expect "my help with things, even when entirely unrelated to RC5/6".

I do that often enough (helping with non RC-related things), 
but then "these things" have to be "interesting enough" or at least "make sense" to me...

You are still on that road, to "make it possible to use JavaScript-libs in a Desktop-App".
and your interpreter therefore aims to "transpile from JS-Objects/libs into VB6-COM-Objects" somehow.

And that's (as I told you many times before) the "entirely wrong direction" IMO, because:
- the trend goes from Desktop-Apps --> to Web-Apps (not the other way around)
- therefore a transpiling from "existing VB6-Source/libs to JS-Objects/libs" would make a whole lot more sense
..(since VB6-sources could then be "pasted" and "re-used" in modern Web-Apps)

That's the main-reason (this "wrong-transpiling-direction") I don't help out anymore with your current project.

Olaf

----------


## Elroy

> glad to know your tryst with accounting software 
> 
> i did not mean to say you needed to enter two records to create a double entry system ... i mentioned the method of bookkeeping which i have found to be most efficient  the entry is made only once (in the age of computers) .. but it appears in two ledgers ... was what i meant ... the single entry system i do not think is very efficient for the kind of account we are talking about (generic, configurable) ( though i am an engineer and all i know about accounting is from the book i posted ... and even then ... i have had many discussions with various chartered accountants .. of my clients ... and none have been able to convince me ( or themselves in the end ) that there is a choice to the double entry (again entry here does not mean duplication of data )
> 
> so 
> party credit 100$
> purchase a/c debit 100$             would become of course
> 
> party       purchase          100
> ...


Yes, it seems like you've got my reasoning.  And yes, of course, any single "accounting" entry record would need a field for where the Debit went and where the Credit went.  For instance, "Cash" & and "Inventory Item X Sold" ... or "Charge Account of Customer Y" & "Inventory Item Z Sold".  It seems like you understand the point I was making though.  Two records, one for the Debit and another for the Credit, just seems like hanging onto a bygone era.

Also, just as a note/question, hasn't this all been rather well done by others?  Quickbooks, Peachtree, etc?

----------


## SearchingDataOnly

Hi Olaf, thank you for your reply, your reply is always so valuable, but there are a few things I need to clarify.





> The RC5/6-libs are thought as an addon-framework, to solve "typical day-to-day-problems"
> (from within "existing and stable languages", using COM-Helper-Objects).
> 
> Whilst your "special case" is (still):
>  - "implementing a new ScriptLanguage+Parser which ends up in a decent AST".


When I talk about scripting language, I'm not just referring to Parser and AST, which were solved 2 years ago and solved very well, and I'm quite happy with myself. Of course, this is done entirely with your help. Much appreciate!

When I talk about my scripting language, I mean Parser, AST, Transpiler, CodeEditor, IDE, and User-Control sets. I've completed the first three tasks, and I'm now working on solving the last three.




> Hey, don't blame the tool, when you reach your own limits... 
> 
> Implementing a decent and fast Script-Parser, is entirely possible with VB6 alone - 
> there's no "Extra-Help needed from RC6-Classes" for that task.
> 
> The only thing such an attempt will require is either:
> 1) understanding how to implement a "flattened Tree, based on UDTs" ... or - alternatively -
> 2) understanding how to "implement a HashList as a lightweight COM-Object"
> ...(along with a handful of other, specialized LW-COM-Objects needed for such a ScriptParser-Engine)
> ...


Yes, I've used both techniques mentioned above. Performance issues and memory-usage issues were resolved 8 months ago. I'm now working on CodeEditor, IDE, and User-Control sets. I'm developing a set of User-Controls like .NET WinForm User-Controls. Initially I planned to draw all user controls in RC6.*Cairo*, but since there is no source code of RC6, I feel that I may not be able to complete this task. So, I'm going to use *GdiPlus* to get my job done. (someone here should know that I actually hate GdiPlus very much). I didn't tell anyone about my development plans, you know, here, even just developing a Spread control would be laughed at for years.

----------


## SearchingDataOnly

> I kind of understand "the frustration when you get stuck with some project" - 
> but you seem to expect "my help with things, even when entirely unrelated to RC5/6".
> 
> I do that often enough (helping with non RC-related things), 
> but then "these things" have to be "interesting enough" or at least "make sense" to me...


What I have done has great significance for the entire VB6 community, even more than RC6. 

RC6 is the best vb6 framework in the world, but it can't change the decline of the vb6 community. If my plan succeeds, the entire VB6 community will be boosted tremendously.

Olaf, you are the wisest and most knowledgeable person in the VB6 community, but you can only use some spare time to do some work that drives VB6. And I'm doing it all my time. Unfortunately, now I'm only one-tenth as productive as I was 10 years ago, and I'm aging beyond my imagination.




> You are still on that road, to "make it possible to use JavaScript-libs in a Desktop-App".
> and your interpreter therefore aims to "transpile from JS-Objects/libs into VB6-COM-Objects" somehow.
> 
> And that's (as I told you many times before) the "entirely wrong direction" IMO, because:
> - the trend goes from Desktop-Apps --> to Web-Apps (not the other way around)
> - therefore a transpiling from "existing VB6-Source/libs to JS-Objects/libs" would make a whole lot more sense
> ..(since VB6-sources could then be "pasted" and "re-used" in modern Web-Apps)
> 
> That's the main-reason (this "wrong-transpiling-direction") I don't help out anymore with your current project.


I'm always used to looking at things from different angles, so I can always see what others don't. I value your point of view, but in the end I will always have my own opinion, and I will never follow the same path that others have taken.

Without your help, my job would have been a lot harder, but I'm still making progress little by little. I'm ready to solve all problems independently. I've never failed on any development task, and I'm sure I won't fail this time either. 

Olaf, thank you again for helping me over the years, and look forward to the day when my scripting language could use your new compiler.  :Smilie:

----------


## Schmidt

> I'm going to use *GdiPlus* to get my job done.


JFYI:
- the GdiPlus-FlatAPI is MS-Windows-only, and closed-source ...
- whereas the Cairo-FlatAPI is open-source (and much easier to use, compared to GDIPlus).

That's just one of many things which "do not add-up" in your posting...

Olaf

----------


## SearchingDataOnly

> JFYI:
> - the GdiPlus-FlatAPI is MS-Windows-only, and closed-source ...
> - whereas the Cairo-FlatAPI is open-source (and much easier to use, compared to GDIPlus).
> 
> That's just one of many things which "do not add-up" in your posting...


I know that the GdiPlus-FlatAPI is MS-Windows-only, and closed-source. The main reason for choosing GdiPlus is that there are a lot of materials about GdiPlus on the Internet, which is convenient to solve the problems encountered in the development process.

----------


## georgekar

I just post this https://www.vbforums.com/showthread....=1#post5589788
for a way to handle variables for a script language. This may help SearchingDataOnly.

----------


## SearchingDataOnly

> I just post this https://www.vbforums.com/showthread....=1#post5589788
> for a way to handle variables for a script language. This may help SearchingDataOnly.


I'm learning your VarFrame. After I understand it, I'll post some feedback. Thank you so much, georgekar.

----------


## ErickTaylora

> Developing a commercial application for your business requires the best techniques and some kind of experience to get efficient software. I tried creating a commercial application myself and failed miserably. Now I prefer a professional approach to development control for the timely detection and prevention of risks.


If you dont have enough experience developing commercial applications, itd make more sense to contact a reputable computer vision software development company. Thus, youll be able to implement your idea most efficiently and get a top-quality app.

----------


## SearchingDataOnly

> If you dont have enough experience developing commercial applications, itd make more sense to contact a reputable computer vision software development company. Thus, youll be able to implement your idea most efficiently and get a top-quality app.


A mature and stable suite of commercial controls is certainly a good choice. But if you want a professional software development company to tailor to your needs, not only do you need to spend dozens of times more, but you also need good luck to ensure that they can provide long-term after-sales service. FarPoint survived for more than 20 years before going out of business (its products were abandoned after it was acquired by someone else)

----------


## fafalone

GDIPlus is only closed source if you're not the type who's willing to look at source leaks  :Wink:

----------


## Schmidt

> GDIPlus is only closed source if you're not the type who's willing to look at source leaks


Well, the legal way of "going about that" would be, to look at the wine-sources, I guess...

There's also a Mono-implementation of that FlatAPI, called "libGDIPlus" on GitHub - 
but this one is mapping against:
...<drum_roll> ...
the *cairo*-FlatAPI (+ pango and a few other needed libs) to implement the whole Shebang platform-independently.

As said already, the cairo-FlatAPI is much nicer structured and easier to use, compared to GDIPlus.

That said, SDO was never really interested in "open-sources" behind a 2D-lib.
What he's interested in is:  "VB6-2D-graphics-examples, ready for Copy&Paste" 
(no matter the 2D-lib, or OpenSource-model).

I'm not handing them out to him anymore ...
("tailored to specific problems", based on RC6.Cairo - for "reasons mentioned above") - 
and so he "switched"...
<shrug>

Olaf

----------


## SearchingDataOnly

I don't think anyone here could have developed a Spread control based on RC6.Cairo with "Copy & Paste" your sample code. You have the illusion that others can solve all the problems they have encountered while using RC6 through the examples you post in vbForums.

I developed my own Spread control with RC6.Cairo and that's because I had developed the first version of the Spread control with GDI and then spent a lot of effort on top of that version to complete the Cario version of the Spread control. It was because of this experience that I did not have the confidence to complete the development of the full set of Win-Form controls with RC6.Cairo. Only ColinE66 is proficient in RC6.Cairo on this forum.

As I said, I chose GdiPlus simply because there is more material to learn and reference. RC6.Cairo is certainly a lot better than GdiPlus, but I don't think the RC6Widgets (based on RC6.Cairo) is a smart design. Why? Because it does not provide the interfaces that most VB6ers are familiar with. That's why Krool's VBCCR and VBFlexGrid are more popular. That's why I'd rather simulate Win-Form controls from scratch than use RC6Widgets.

Also, my choice of GdiPlus was only a temporary transition, just to get my work done as quickly as possible, and I didn't plan to use it for a long time.

I euphemistically mentioned a few years ago that RC5Widgets would not be a popular tool for VB6ers and RCers, and a few years later, RC5Widgets/RC6Widgets now have almost zero presence. Now that I've decided not to be euphemistic, I'll make my point clear: if your IDE is based on RC6Widgets, the probability of its popularity is almost zero.

Regarding whether RC5/RC6 should be open source, it makes no sense to discuss it now. It should be open source 5 years ago, and now it has lost its best open source time.

----------


## georgekar

I think the "open source" for RC5/6 should be not the case for using it. Because there is a lot of other closed type libraries out there which used and are closed. Each library has unique features, otherwise would be a copy. Maybe some time mr Olaf make a pdf file, a proper manual with examples for the programmer. RC5/6 has a lot of things and has to be described not only for the input/output but also for the expected behavior. Maybe a good tool would be an automatic visual form designer, as an add in in Vb6 for forms using RC6.

I have made my own UCs, and after time they grow so match which is difficult to remember about what each event do exactly and when, and I have to look the code, and some time I get it wrong, and pay for hours to find what is going wrong. This is for my own UC. Try this with a foreign one, using 40 properties/methods and 30 events, with no proper documentation (source may not help, same and worse like my own UCs). Some time I argued with Olaf about documentation, and he said there is one. Yes but isn't good enough. He needs a supporting community to take care for all of us. Snippets here and there maybe help for demo purposes. Maybe here in vb6 a new forum for RC6 interesting people will be helpful. That non existing yet forum may have chapters for each element from RC6. I think this proposal not break forum directives.


Although a GDIplus solution may works for "Ever", the transfer to a compact, not changed and well written solution like cairo, maybe produce more stable code. 

I think the future of programming will be the solutions on containers (VM's). So not only you will distribute a program but you will give one big "environment" which have at the top the "application", your program. The same exist now with apps in Android (you see some apps using 30MB for something which on a Win32 application can be some Kbytes). Memory now isn't hard to find/utilize in an ordinary desktop and hand held devices, for execution and storage purposes. Our devices soon will be "transputers", computers which change "personality" upon choice of application. So now an android app can run in Windows 11, and some day the reverse may happen too. The last solution will be a generic VM for running VMs. So your OCX, DLL and any peculiar software can live and act anywhere, and then some clever programmers may write own VM (a class of generic), and offer the extreme new own programming style and use of a tool chain, in an application for all devices transparent to the user.

----------


## Schmidt

> I don't think the RC6Widgets (based on RC6.Cairo) is a smart design. 
> Why? Because it does not provide the interfaces that most VB6ers are familiar with. 
> ...
> That's why I'd rather simulate Win-Form controls from scratch ...


If you compare 2 "widget-engine designs" regarding "smartness", 
I'd think the "winning design" should be considered the one, 
which accomplishes "the same thing with significantly less needed interfaces" 
(when we talk about COM-based Control- or Widget-Engines).

JFYI - the RC6-Widget-Engine needs significantly less interfaces - 
because its COM-based Siting-mechanism does *not* require dozens of OleAut-interfaces.
Instead you can define your own UserControl (or Widget) in a "plain, vanilla Class".

*Ok, let's put forward a few definitions for a well-designed Control- or Widget-Engine:*
*1)* It should allow the User, to design his own Controls (his own Widgets) using his own Code
*2)* the Code he's using, shall not be restricted to a specific language (like e.g. VB6)
.. (all what the language needs would be: COM-support + COM-Event-support)
*3)* Within such a (Widget)Class the user should be offered Graphics-support, to render "anything with ease"
.. (a "Paint-Event" comes to mind, along with support for "all kind of other Events, such a Widget might make use of after siting")
*4)* The "Drawing-Context" which is offered in such a Paint-Event should be based on an Object, which abstracts from the underlying 2D-lib 
*5)* Ideally, the used 2D-lib should be available on all platforms (when the language itself is planned to have multi-platform-support as well)

Well - and the Usercontrol-engine, which is built-into VB6, fullfills only 1) and 3) of the above -
whereas the RC6-engine fullfills *all* of the above requirements.

Here's an example for VBScript (to prove my point):

You want to implement a Widget in VBScript? ... well this Class would be sufficient
(including Visualizations for Hover and Focus/Tabbing):


```
Class cwMyWidget 
    Private W  'our class-internal Cairo.WidgetBase  

    'two Properties, any cwClass needs to implement (to be recognized as a Widget)
    Public Property Get Widget():  Set Widget  = W:         End Property
    Public Property Get Widgets(): Set Widgets = W.Widgets: End Property

    Private Sub Class_Initialize()
      Set W = Cairo.WidgetBase 'instantiate the internal "W-WidgetBase"
          W.BackColor = vbYellow: W.ForeColor = vbRed: W.Alpha = 0.6
          W.Moveable = True '<- to allow dragging a Widget around on its Container
    End Sub

    Public Sub Paint(ByVal CC, ByVal dx, ByVal dy)
        CC.RoundedRect 0, 0, dx, dy, 7, True
          CC.SetSourceColor IIf(W.MouseOver, W.HoverColor, W.BackColor), W.Alpha
        CC.Fill True '<- don't close the path yet (a BorderStroke-Def is yet to come)
          CC.SetSourceColor IIf(W.Focused, W.FocusColor, W.BorderColor), W.Alpha
        CC.Stroke 'now draw the rectangle in one go (with InFill and BorderStroke)

        'draw some centered Text, using the current W.Font...Props and W.ForeColor
        W.SelectFontSettingsInto(CC)
        S = "Hello World!" & vbCrLf  & vbCrLf & "W.Key: " & W.Key
        CC.DrawText 0, 0, dx, dy, CStr(S), False, 2, 4, True
  End Sub
End Class
```

Below the complete VBScript-TextBlock which includes the above Widget-Class-definition
If you put this content into a TextFile with the ending *.vbs - and then DoubleClick it - 
you should see the following result on all machines which have a recent RC6-version installed)


Here the full Script-Code:


```
With CreateObject("WScript.Shell") 'this block auto-reshells a script to the 32Bit-WSH-version on Win64 (if needed)
  WS32on64 = .ExpandEnvironmentStrings("%SYSTEMROOT%\SysWOW64\wscript.exe")
  If StrComp(WScript.FullName, WS32on64, vbTextCompare) then 'so, when the Paths' differ, we...
     If CreateObject("Scripting.FileSystemObject").FileExists(WS32on64) Then '...check if the target is there at all...
     .Run """" & WS32on64 & """ """ & WScript.ScriptFullName & """", 1, False '...and re-launch the script with it
     WScript.Quit '... before we finally exit this (64Bit-)instance of the ScriptHost-Process
     End If
  End If
End With

'------------------------ COM-Library- and Form-Inits ---------------------------
Set New_c = CreateObject("RC6.cConstructor")
Set Cairo = New_c.Cairo
    Cairo.ImageList.AddIconFromResourceFile "frmICO", "shell32", 167 'let's load an Icon-Resource from shell32.dll
    Cairo.ImageList.AddSurface "frmBG", Cairo.CreateCheckerSrf(6, &H444444) 'and another resource for the Form-BackGround

Set Form = Cairo.WidgetForms.Create(2, "Userdefined Widgets in VBScript (with Hover and Focus-Tabbing)", True, 600, 400)  
    Form.SetMinMaxDimensions 320, 240, 1024, 768 'optional, just to show that it exists ;-)
  Form.IconImageKey = "frmICO" '<- use the Img-Resource we added a few lines above, as the Form-Icon
    Form.WidgetRoot.ImageKey = "frmBG" '<- same here, for the Forms-BackGround-Image
    Form.WidgetRoot.ImageKeyRenderBehaviour = 6 'ImageKeyRenderRepeat
    
WScript.ConnectObject Form, "Form_" '<- EventSink-Binding and -Prefixing the VBScript-way

Form.Show 1 'let's show the Form finally
 
'------------------------ Form-Event-Handlers ---------------------------
Sub Form_Load() ' Siting of two Control-instances, directly from a Class-Definition
    Form.Widgets.Add New cwMyWidget, "Widget1", 10, 10, 111, 88 
    Form.Widgets.Add New cwMyWidget, "Widget2", 99, 77, 111, 88
End Sub
 
Sub Form_BubblingEvent(Sender, EventName, P1, P2, P3, P4, P5, P6, P7)
  Select Case EventName
    Case "W_Paint" : Sender.Paint P1, P4, P5 're-route to the Class' Paint-Method
    Case "W_MouseEnter", "W_MouseLeave": Sender.Widget.Refresh 'Hover-Refreshs
  End Select
End Sub

'------------------------ our User-defined WidgetClass ---------------------------
Class cwMyWidget 
    Private W  'our class-internal Cairo.WidgetBase  

  'two Properties, any cwClass needs to implement (to be recognized as a Widget)
    Public Property Get Widget():  Set Widget  = W:         End Property
    Public Property Get Widgets(): Set Widgets = W.Widgets: End Property

    Private Sub Class_Initialize()
      Set W = Cairo.WidgetBase 'instantiate the internal W-WidgetBase 
          W.BackColor = vbYellow: W.ForeColor = vbRed: W.Alpha = 0.6
          W.Moveable = True '<- to allow dragging a Widget around on its Container
    End Sub

    Public Sub Paint(ByVal CC, ByVal dx, ByVal dy)
        CC.RoundedRect 0, 0, dx, dy, 7, True
          CC.SetSourceColor IIf(W.MouseOver, W.HoverColor, W.BackColor), W.Alpha
        CC.Fill True '<- don't close the path yet (a BorderStroke-Def is yet to come)
          CC.SetSourceColor IIf(W.Focused, W.FocusColor, W.BorderColor), W.Alpha
        CC.Stroke 'now draw the rectangle in one go (with InFill and BorderStroke)

        'draw some centered Text, using the current W.Font...Props and W.ForeColor
        W.SelectFontSettingsInto(CC)
        S = "Hello World!" & vbCrLf  & vbCrLf & "W.Key: " & W.Key
        CC.DrawText 0, 0, dx, dy, CStr(S), False, 2, 4, True
  End Sub
End Class

'just a small helper-function (... VBScript does not come with IIF()-support)
Function IIF(Expr, TrueReturn, FalseReturn) 
  If Expr Then IIF = TrueReturn Else IIF = FalseReturn
End Function
```

With only slight adaptions, the above should also be able to run in:
VB6, VBA, TwinBasic, VB.NET

And with a few more changes due to "language-specifics" one can include also:
FreeBasic, Delphi, C#, C++, JScript, AutoIt

@georgeKar
If your own scripting-language has support for COM-Objects and -Events,
then you should be able to use this as well.

If you have already developed your own "GUI-Engine for nested Controls/Widgets" - 
you could "put it to the test" in the same manner (or at least check it against the points *1)* to *5)* above).

Olaf

----------


## georgekar

I can open forms from Rc6, and handle events too. I told many years in the past that my problem is the close button, which stop everything if someone hold it down as long doing that, and for M2000 means stop threads, as they implemented, in a single thread manner. I would like to have a close button to send a cancelable event, and a final close event, which fired on double click the close button (I use the same on M2000 user form). I didn't use real button for close button but a user control, which check mouse over area, for all control pseudo buttons. So the other option for me is to use the Widgets on my M2000 user form, a standard vbform with no title bar (i use the control as described before for title bar, plus another form to handle tha task line button which I can minimize, show again, and close the form through it). So basically I think you should provide a standard user control with a cairo surface like a frame control which can hold a series of widgets, including those who you just described. I don't know if your dll can support a loadable user control, or has to be an ocx type.

----------


## SearchingDataOnly

> If you compare 2 "widget-engine designs" regarding "smartness", 
> I'd think the "winning design" should be considered the one, 
> which accomplishes "the same thing with significantly less needed interfaces" 
> (when we talk about COM-based Control- or Widget-Engines).
> ...
> ...


Hi Olaf, thank you for your detailed and professional response, but we seem to be talking about two different topics.

From a technical point of view, your designs are almost always very smart. But what I mean by "smart" is from a user perspective. (You are a technical expert, and I'm an usability expert, user-needs analysis expert and product-experience expert  :Smilie:   )

I've been using SqliteDB for many years, but I rarely ask you questions about SqliteDB. Why? Because you wrapped the provider of SqliteDB into almost exactly the same interfaces as ADODB. A person familiar with ADODB operations can operate SqliteDB in a familiar way without any learning, which is an extremely "smart" approach.

But on the packaging of Cairo, you take a different approach, and the operation of RC6.Cairo and RC6Widgets is completely different from GDI and traditional VB6 controls. I've designed hundreds of user controls, and I can easily design a full suite of Ms-Common-Controls, but when I learn to use RC6.Cairo and RC6Widgets, I need to ask you all kinds of simple questions like a schoolboy, and at the same time, you have to spend a lot of time responding to my simple questions, which is really awful, I don't think it's "smart" design.

If you package RC6.Cairo as c_GDI, c_Control, c_UserControl, c_VBControlExtender, c_PictureBox, etc., then I don't need to ask you any questions, I can design various user controls very skillfully.

If I think RC6.Cairo and RC6Widgets difficult to use, then I'm sure almost 99% of VB6ers will find it difficult to use.

You can list 1,000 technical reasons why RC6Widgets are better than Krool's VBCCR, but users only need one reason to reject RC6Widgets: VBCCR is almost fully compatible with ms-common-controls.

It's the New Year soon, so let's talk about it for the time being. 

Happy New Year to you and Happy New Year to everyone here.

----------


## Schmidt

> I can open forms from Rc6, and handle events too. 
> I told many years in the past that my problem is the close button, 
> which stop everything if someone hold it down ...


And as explained at that time, that "blocking behaviour" is Win-OS-specific (not RC6-specific).

Well, have uploaded an example into the CodeBank, which shows how to circumvent that blocking:
https://www.vbforums.com/showthread....nd-a-solution)

HTH

Olaf

----------


## Schmidt

> ...the operation of RC6.Cairo and RC6Widgets is completely different from GDI and traditional VB6 controls.


*Yes*, RC6.Cairo and GDI are different, because:
- GDI is a FlatAPI (based on a hDC-Handle in the first parameter of its calls)
- and RC6.Cairo is an Object-Wrapper which encapsulates a true Vector-Graphics-Library
.. (where a "Path-concept" and "Transforms" are dominant - and "primitive calls" like Rectangle, Line, Arc secondary)

If I'd have squeezed the cairo-functionality into a "GDI-corset", 
then functionality would have been lost (and users who know cairo already would feel alienated).

Besides, if you wanted a wrapper to use GDI more comfortably, there is two wrapper-classes already -> RC6.cDC and RC6.cDIB.
(though using them in todays VB6-code, would make this code useless on other platforms - e.g. when TwinBasic reaches that state).

And *No*, the RC6-WidgetEngine is only slightly different from VBs UserControl-concept 
(I'd say it is 90% compatible ... quite similar to SQLite.cRecordset and ADO.Recordset, if you ask me).

You mentioned, that wrapping c_Control, c_UserControl, c_VBControlExtender would make more sense - 
but all three of the above are basically the same thing - and are encapsulated in the type:
- cWidgetBase 
- which is "the little W-Variable" on the *inside* of a Control/WidgetClass (similar to "UserControl" on the inside of a VB *.ctl)
- on the *outside*, you can access this via the MyWidgetVariable.*Widget*-Property (to get "the Control-Extender", so to say)

Since you claim to have "experience in abundance" with UserControls,
it should not take you more than an hour, you implement a little VB-UserControl from scratch:
- e.g. a little Horizontal-Slider-Control (with a rectangular "track" and a simple "circular Gripper-button")
- Min-Max "hardwired internally to 0-100" (to save exposing this as Properties)
- a ValuePercent-Prop "as Double"
- and a simple, singular "Change-Event"
- nice to have would be Hover-Functionality when the Mouse is on top of the circular Slider-Button
All of this implemented via GDI-APIs in the UserControls Paint-Event...

You'll be surprised, how similar the Class-based Widget-Code will look like,
when I post an appropriate RC6-implementation in turn.

Olaf

----------


## SearchingDataOnly

> Besides, if you wanted a wrapper to use GDI more comfortably, there is two wrapper-classes already -> RC6.cDC and RC6.cDIB.
> (though using them in todays VB6-code, would make this code useless on other platforms - e.g. when TwinBasic reaches that state).


It's something else entirely.





> And *No*, the RC6-WidgetEngine is only slightly different from VBs UserControl-concept 
> (I'd say it is 90% compatible ... quite similar to SQLite.cRecordset and ADO.Recordset, if you ask me).
> 
> You mentioned, that wrapping c_Control, c_UserControl, c_VBControlExtender would make more sense - 
> but all three of the above are basically the same thing - and are encapsulated in the type:
> - cWidgetBase 
> - which is "the little W-Variable" on the *inside* of a Control/WidgetClass (similar to "UserControl" on the inside of a VB *.ctl)
> - on the *outside*, you can access this via the MyWidgetVariable.*Widget*-Property (to get "the Control-Extender", so to say)


According to your logic, Chinese and English are a very similar language, they are 99% compatible, for example: red--红色, yellow--黄色, blue--蓝色, you--你, I--我, he--他.

You are a multilingual developer, you don't understand the mindset of most monolingual developers, and you don't understand the mindset and programming habits of most VB6ers.





> Since you claim to have "experience in abundance" with UserControls,
> it should not take you more than an hour, you implement a little VB-UserControl from scratch:
> - e.g. a little Horizontal-Slider-Control (with a rectangular "track" and a simple "circular Gripper-button")
> - Min-Max "hardwired internally to 0-100" (to save exposing this as Properties)
> - a ValuePercent-Prop "as Double"
> - and a simple, singular "Change-Event"
> - nice to have would be Hover-Functionality when the Mouse is on top of the circular Slider-Button
> All of this implemented via GDI-APIs in the UserControls Paint-Event...
> 
> ...


You should know that I've done this more than 20 times about converting GDI to Cairo or Cairo to GDI.

Olaf, no need to reply anymore, enjoy the New Year's holiday  :Smilie: . I'll use GdiPlus to finish my work first, and then convert GdiPlus to Cairo, I believe that 90% of the code is reusable. I seem to be doing code conversion most of the time.

----------


## SomeYguy

> Boy, I've sure got a different opinion than many about this.  Personally, I'll never put any "purchased" controls in any of my distribution software for which I don't also get the source code to.  There's just so much garbage out there, with some of it appearing to come from "glossy, established" companies.  IMHO, it's just asking for trouble down the road.
> 
> But I'm also willing to do the hard work to make my own custom controls to do whatever I want.  One I'm particularly proud of is a custom combobox which has different colors for each item in the dropdown.  In addition, it can have a tooltip for each item in the dropdown.
> 
> In other words, when we're willing to do it ourselves, we can meet our specific needs.
> 
> As another example, I'm finishing up another project where I'm using Eduardo's latest tab-control, and I'm using his TDI (Tabbed Dialog Interface) option where the tabs have close (X) buttons on them.  However, I only want the user to be able to close the last tab.  So, I tweaked his code to have that option.  I couldn't have done that with off-the-shelf (non-source-code) software.


True enough but I do buy from small developers when the need is there and will fit my goals. By doing so you are helping to support a person or perhaps family who needs the income and also are contributing to overall economy. I support them whenever possible but as with you, I usually end up creating whatever I need these days.....

----------

