|
-
Apr 20th, 2015, 05:12 PM
#1
Re: Program Testers
About vbWidgets:
1) where should I put the vbWidgets.DLL ? (I put it in App.Path)
I have AppPath\vbRC5BaseDlls containing the RichClient DLLs
2) is it correct (to make it RegFree) my change on vbWidgets SubMain ?:
Code:
Declare Function GetInstanceEx Lib "DirectCOM" (StrPtr_FName As Long, StrPtr_ClassName As Long, ByVal
UseAlteredSearchPath As Boolean) As Object
Public New_c As cConstructor, Cairo As cCairo
Public Sub Main()
'' ORIGINAL
''
' On Error Resume Next
' Set New_c = GetInstanceEx(StrPtr(App.Path & "\vbRichClient5.dll"), StrPtr("cConstructor"), True)
'
' If New_c Is Nothing Then
' Err.Clear
' Set New_c = New cConstructor
' End If
'
' Set Cairo = New_c.Cairo
'
' Set Cairo.Theme = New cThemeWin7
'' Cairo.FontOptions = CAIRO_ANTIALIAS_DEFAULT
'''''''''''''''''''''''''''''''''''''''''''''' MY way
Set New_c = GetInstanceFromBinFolder("vbRichClient5", "cConstructor", "vbRC5BaseDlls")
Set Cairo = New_c.Cairo
Set Cairo.Theme = New cThemeWin7
'-------------------------------------------
End Sub
3) Where can I find Other Branches of vbWidgets ?
4
 Originally Posted by Schmidt
With the Widget-Engine there's no such "hurdles to jump over" or points where you might get stuck.
Not so easy, I succeded on changing a little bit the cwFileList
so that when a Key is pressed, it set its position to the first item that start with pressedKey-character.
(quite like VB-Control)
5) How to set the Zorder of widgets ?
ah, ok, they seem to follow the "Form.Widgets.Add(" creation order.
At the moment I do not need to change it at Runtime.
6) PropertyGrid-Widget
 Originally Posted by Schmidt
I'd tackle that in the way the VB-IDE is working as well - developing a PropertyGrid-Widget, which in the left column shows the Property-Names (your Parameters) - and in the right Column shows the Value (depending on the Value-Type, switching between TextBox, Combo or CheckBox).
Sounds really what I need...
If you encapsulate your Imaging-Algorithms in your own Dll (each Algo residing in its own Class - and this Class simply having a List of Public Properties for your Parameters), then the filling of such a Property-Grid-Widget would become quite simple, by just using the Classes cProperties and cProperty from the RC5 (enumerting the Props, their Names and Values, and also the Value-Type is included, as well as Enum-Members in case of an Enum-Type (to be able to fill a small Combo for the Enum-Values, the same way the VB-IDE does).
Seems so easy, but not to me...
Even just only Implementing the PropertyGrid-Widget is an hard challenge for me.
Does standard cwGrid implement "right Column shows the Value (depending on the Value-Type, switching between TextBox, Combo or CheckBox)." ??? [I need HscrollBar too]
In the PropertyGrid-Widget should appear only the properties of Selected Node
-When a Node is Clicked Public-PARAMS-UDT-variable values should be "transfered" to the Grid (and diplay only them)
-When user tweaks properties on GRID they should be transfered to the Public-PARAMS....
I'm thinking about an easyer way...
-
Apr 21st, 2015, 08:18 AM
#2
Re: Program Testers
 Originally Posted by reexre
About vbWidgets:
1) where should I put the vbWidgets.DLL ? (I put it in App.Path)
I have AppPath\vbRC5BaseDlls containing the RichClient DLLs
Always put it beside vbRichClient5.dll for regfree deployment, so this is correct.
 Originally Posted by reexre
2) is it correct (to make it RegFree) my change on vbWidgets SubMain ?:
No, what's already there inside Sub Main was correct - and ensures that
the vbWidgets.dll can use *other classes from the RC5 regfree internally*.
In your case, you want to create instances of Classes regfree, which vbWidgets.dll
*exports* on its outside interface (all of the cwWidget-Thingys).
And so, this case has to be handled within your App, not in vbWidgets.dll.
I've seen, that you re-create a New_c (along with a Cairo) regfree in each and
every Class in your StdExe-Project. That is *not* necessary.
When New_c and Cairo are defined Public in a *.bas Module, then they are
automatically "visible" and usable in each and every code-snippet in your
entire Project, so they have to be created Regfree only *once* (in Sub Main()).
Now, to create Widget-Classes regfree from within your Std-Exe-Project,
I usually write a small function for that ....(Public, and placed in the same
Code-Module (besides Sub Main()):
Code:
Public Function NewWidget(ClassName As String) As Object
If App.Logmode Then 'we run compiled
Set NewWidget = New_c.RegFree.GetInstanceEx(App.Path & "\vbRC5BaseDlls\vbWidgets.dll", ClassName)
Else 'we run in the IDE, so we create the instance from the registered version
Set NewWidget = CreateObject("vbWidgets." & ClassName)
End If
End FUnction
 Originally Posted by reexre
3) Where can I find Other Branches of vbWidgets ?
The one on GitHub is the one to use, if you have useful enhancements which
you think should be placed in the Master-Branch there, post them to me,
or make a Git-Pull-Request.
 Originally Posted by reexre
4
Not so easy, I succeded on changing a little bit the cwFileList
so that when a Key is pressed, it set its position to the first item that start with pressedKey-character.
(quite like VB-Control)
That would be a change you could mail me, so that I can update the GitHub-Repo.
 Originally Posted by reexre
5) How to set the Zorder of widgets ?
ah, ok, they seem to follow the "Form.Widgets.Add(" creation order.
At the moment I do not need to change it at Runtime.
IIRC there should be already a "MoveToFront"-Method in cWidgetBase.
 Originally Posted by reexre
6) PropertyGrid-Widget
Seems so easy, but not to me...
Even just only Implementing the PropertyGrid-Widget is an hard challenge for me.
Does standard cwGrid implement "right Column shows the Value (depending on the Value-Type, switching between TextBox, Combo or CheckBox)." ??? [I need HscrollBar too]
In the PropertyGrid-Widget should appear only the properties of Selected Node
-When a Node is Clicked Public-PARAMS-UDT-variable values should be "transfered" to the Grid (and diplay only them)
-When user tweaks properties on GRID they should be transfered to the Public-PARAMS....
I'm thinking about an easyer way...
First thing to make it easy should be, to transfer all your Imaging-Algos into a Dll-Project -
wrapping each of the Algos in its own Class (with all its Parameters as Public Properties).
Example for an RGB-Color-Inversion-Algo:
Code:
Option Explicit
'the Properties are free definable, and can be enumerated completely with the RC5.cProperties-Enumerator later on
Public OnRedChannel As Boolean
Public OnGreenChannel As Boolean
Public OnBlueChannel As Boolean
Private Sub Class_Initialize() 'set Default-Values
OnRedChannel = True
OnGreenChannel = True
OnBlueChannel = True
End Sub
'Now, two generic (unchanging) Public Methods, each Class has to implement in the same signature
'one for Pixels, to process in a Surface-Container
Public Sub PerformOnSurface(Src As cCairoSurface, Dst As cCairoSurface)
If OnRedChannel Then 'perform your Inversion Loop on the Red-Bytes of Src
End If
If OnGreenChannel Then ... a.s.o.
End Sub
'and one for your Double-Precision-Arrays
Public Sub PerformOnDoubleArrays(SrcR() As Double, SrcG() As Double, SrcB() As Double)
If OnRedChannel Then 'perform your Loop on SrcR
End If
If OnGreenChannel Then ... a.s.o.
End Sub
'Maybe two additional Properties should be defined in such a default-interface on each of those Classes
Public Property Get SupportsSurfaces() As Boolean
End Property
Public Property Get SupportsDoubleArrays() As Boolean
End Property
With such a generic usable Dll-Class-definition (which later on would even allow People
to contribute "Plugins"), you should be able to cover most of what you currently have.
I mean, why not "doing it right from the get-go", since you're currently in a re-design-
phase anyways...
Remember, that you can easily load such an "Algo-Class-Definition" from your Dll
regfree later on (quite similar to what you do with vbWidgets.dll-Classes) - and you could
run them in the IDE (whilst developing your surrounding GUI-Project) *native-compiled*
in full-speed (from the compiled Dll).
I know that such "architectural-considerations" are sometimes "hurtful for the creative mind"
(which doesn't want to get bothered with such "unimportant details") - but once you have it
in place, you will thank yourself later on, when the project evolves.
Olaf
Last edited by Schmidt; Apr 21st, 2015 at 12:27 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|