Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 5 Jahren, 9 Monaten
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
Yogi Yang, Arie, Pragma Tix, iso

Building Native Controls for WinDev

Startbeitrag von Yogi Yang am 04.10.2012 04:26

I have been WD for quite some time now!

I have observed that there are many situations where in we need to achieve something which is not possible purely in WD.

Say for example in the software that I am converting over to WD I have a need to allow user to load image and then adjust its or process it like by adjusting the images brightness/contrast, resizing image, watermarking image, load other images in different layers and then blend them with base image, etc.

Doing such tasks purely in WD with WLang would be impractical and very slow.

In the same way we have used the open source and dynamic Firebird RDBMS in many of our projects but I cannot find one descent native driver that will allow me to access Firebird's database.

I think this extendability is necessary in WD.

If we look around such native extendability is generally available in almost all development tools worth its salt. Take for example Clarion. One can extend it using templates (or something like ;) I am not a Clarion developer so don't know the exact terminology).

I would like to know if there is any documentation that teaches, how to build native controls or drivers for WD.

Yogi Yang

Antworten:

Hi Yogi,
1) Firebird native driver.
I aggree to 100 % that it would be nice to have a native driver from PCS. I also have to mess around with OLEDB+Firebird. May SQLManagerX is an option for you.
I don't like Firebird.
No boolean datatype, No autoincremental numbers, instead generators(), lousy bulk import performance.

2) Creating a native control in WD
Is absolutely possible in W-Language and WIn API Programming.
a) Create a an empty control template
b) InitCode of this control template should contain f.i.
Myhandle is int = Handle(Myself)
You will need this Handle later. As ParentHandle.
c) Creaste the Control, a new control from the scratch, or an exiting one, via the windows api. The API function CreateWindowEx() is your friend.
A very good site , regarding creating a custom
control from the scratch :

http://www.catch22.net/tuts/custom-controls

(I have used this technic to wrap the Scintilla code editor control)

Using a control template will enable you to set anchors etc, in other words, your new shiny control behaves like a standard WD control

Edit..
3)Creating a custom database driver for WX.
You can create a DLL in C++/D, and create DLL functions wrapping the native database C-API.
This is what SQLManageX is about.

Unfortunately PCS is not offering their DB-Driver specification. (Header file would be enough) Means that you will have very hard times to implement HReadXXX and the like functions. (This is nertheless possible) But you will have no analysis suport, no GUI designer support etc. etc. Too sad.:(

HTH
#pragma

von Pragma Tix - am 04.10.2012 08:19
Quote
Pragma Tix
1) Firebird native driver.
I aggree to 100 % that it would be nice to have a native driver from PCS. I also have to mess around with OLEDB+Firebird. May SQLManagerX is an option for you.
I don't like Firebird.
No boolean datatype, No autoincremental numbers, instead generators(), lousy bulk import performance.

These features were the reason for which we use Firebird. :). We have never needed to do any kind of Bulk Import in Firebird so can't about this.

Quote
Pragma Tix
2) Creating a native control in WD
Is absolutely possible in W-Language and WIn API Programming.
a) Create a an empty control template
b) InitCode of this control template should contain f.i.
Myhandle is int = Handle(Myself)
You will need this Handle later. As ParentHandle.
c) Creaste the Control, a new control from the scratch, or an exiting one, via the windows api. The API function CreateWindowEx() is your friend.

I know we can build Control Template but what I want is a way to build native controls that a WD user can attach to their project and use them as though they are standard WD controls.

Writing a control using WLang will result in slow performance in many instance. As for the example I have stated in my first post. If I have to process a 10 in X 8 in image which is of 200 DPI to make color corrections to that image WLang will take ages in doing this. In such situations controls built in a true comiled language like C++ or Delphi will give reasonable performance.

I did go throught the Catch22 tutorial but I am not interested in building something in C++.

I would prefer to use Delphi.

Quote
Pragma Tix
3)Creating a custom database driver for WX.
You can create a DLL in C++/D, and create DLL functions wrapping the native database C-API.
This is what SQLManageX is about.

SQLManagerX web site is not in Englisht so I can't make head or tail of what is there.

Anyways thanks for your suggestions.

But my main point is that PCSoft should officially release documentation and samples that will allow other developers to build true native controls and drivers for WinDev.

I will go to the extent to say that PCSoft should also add facility to the IDE so that one can build plugins for the IDE to enhance it.

von Yogi Yang - am 04.10.2012 10:32
SQLManagerX contains, among others, a native Firebird database driver. Using this driver will limit you to use pure SQL.

I see your point and I aggree. It would be nice to have something like Delphi VCL.
PCS missed the historical change to buy the QT toolkit from Nokia.

However you can create a custom control in Delphi, and embed this control within a control template.
You can make this control´template available via a) SCM, or b) Resuablity center. Not pefect, but a solution.

Porting the Catch22 code into W-language is a piece of cake, no ?

Regarding your imaging problem, maybe you should create a wrapper for imageMagic. and use the WD image control. Another Idea is to use the GTK#s Cairo. but well..

#pragma

von Pragma Tix - am 04.10.2012 10:50
If you are looking for graphic stuff far beyond the WD image control, this is the place to go:
http://www.zapsolution.com/DW/US/windev.html
Very easy to implement in WD, because of the numerous examples and great help of Patrice.

von Arie - am 04.10.2012 11:25
Quote
Arie Mars
If you are looking for graphic stuff far beyond the WD image control, this is the place to go:
http://www.zapsolution.com/DW/US/windev.html
Very easy to implement in WD, because of the numerous examples and great help of Patrice.

I know about GDImage. It does have very good set of features but the features that we need are missing like for example layers support, vector annotations, blend modes, etc.

What I am try to replace can be found here: http://www.imageen.com/info/index.html

von Yogi Yang - am 04.10.2012 13:29
Mmh, very impressive.
It look like they have an ActiveX? This can be used in WD without any problem.
WD also supports .NET controls, according to the docs. Never tried.....

von Arie - am 04.10.2012 13:40
Quote
Arie Mars
It look like they have an ActiveX?

I know about ActiveX but unfortunately it is not as easy to use as the VCL version. In fact in the ActiveX verson in some of the properties and methods we have to pass strings that describing our action and that is feel a bit out of sync from the way one is used to working with controls esp. with VCL in Delphi. :(

And looking at the feature set its price tag is also very, very reasonable.

Of course if I cannot find any alternative then I will have to use the ActiveX.

von Yogi Yang - am 05.10.2012 05:02
Hello Yogi,

I purchased the ImageEN, i noticed on a thread you have experience of this within Windev? Wondered if you could advise me on how to get started with it?

Any help would be appreciated.

Many Thanks

Iso

von iso - am 20.06.2013 11:13
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.