![]() |
#1
|
|||
|
|||
![]()
For binding the custom button to the program we use the following:
(Before we create a toolbar TEST (only 12 Corel)) Application.CommandBars("TEST").Controls.AddCustomButton "2948", "globalmacros.module.sub", 3, False globalmacros.module.sub << This line starts our sub from gms module. But how to create the button which starts not the vba-program, and add-in the program? I install the Plotter11 (Alex-soft) there coustom button work all right. How you created this button (to Alex)? |
#2
|
||||
|
||||
![]()
Plotter isn't an add-in. It IS a macro. I just install an extra GMS module.
Also, I do not add the button programmatically. The setup just installs a separate workspace which I created manually on my machine and added the macro button to the toolbar. I hope this helps. |
#3
|
|||
|
|||
![]()
Earlier I too exported a part of WorkSpace (my toolbar), but here there is a problem with language compatibility (only in Corel 11): the toolbar for the English version Corel does not work for other languages Corel.
And program, which I now have written can not be as macro, since it should work quickly (algorithm of figured accommodation of graphic elements on a sheet). It should seems to me to exist any way of introduction of a toolbar in CorelDRAW for add-in... |
#4
|
||||
|
||||
![]()
I can tell you for sure that there are no ways of adding a toolbar button for an add-in.
However I'm not convinced that your program cannot be a macro. VBA macros are pre-compiled also and almost as fast as compiled VB exe's. Just look at my CurveWorks. All the curve processing is done in pure VBA. I just read in curve information from CorelDRAW, then process all the curves using VBA's arrays, and internal functions, then put the nodes back in the curve. Of course, if you go and start operating nodes in CorelDRAW document one by one it will be slow, but not because VBA is slow, but because CorelDRAW is slow and it does a lot of things (like logging transactions each time you modify a document so that the user can Undo the change). Just run the following simple macro: Code:
Sub TestSpeed() Dim tm As Double Dim i As Long Dim a As Double tm = Timer For i = 1 To 1000000 a = Sin(12.7) Next i MsgBox "It took " & (Timer - tm) & " seconds to execute" End Sub Just my opinion. |
#5
|
|||
|
|||
![]()
But I use up to 8 enclosed cycles for... next, where from each fifth level the function also having investments of cycles is caused. 1.5^8 = it is long.
Plus difficult multilevel variable (it requires algorithm). It is all underestimates productivity of the program at 10-13 in VBA / VB6! Now unique for me a way of a conclusion of a toolbar, this creation of a window atop of others with buttons as on a toolbar, but it is not pleasant to some my users. ![]() |
#6
|
||||
|
||||
![]()
Well, it doesn't really matter how many levels of loops you have, the relative difference will be the same. Yes, each program will execute slower, but in the end the difference will still be pretty much the same - 1.5 times. Now, this figure was for calculating Sin in a simple loop. This could be different if you are doing some string manipulation or arrays or stuff like that, but I would suspect it will not be that much different, because most of those are still done in VB runtime DLLs which are exactly the same for both VB program and VBA.
If anything else, I would still create your DLL, export some functions, then create a simple macro which will call those functions. But doing this, you'll still have a "macro" to put a button on toolbar and your actual code will be in a DLL... Might be a solution. |
#7
|
|||
|
|||
![]()
1. Yes, it is valid investments the roles do not play.
But I have forgotten to tell, that before compilation of the program, I include Advanced Optimization: Assume No Alising Remove Array Bounds Checks etc. It raises productivity at 10-50 times!!! 2. It is interesting idea. But I shall try still to create a toolbar. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom crop and invert - Is this possible? | geopig | Corel Photo-Paint VBA | 1 | 01-11-2004 13:28 |
creating command buttons | bumblebee | CorelDRAW/Corel DESIGNER VBA | 1 | 31-08-2004 08:35 |
Custom Command Buttons | ddonnahoe | CorelDRAW/Corel DESIGNER VBA | 1 | 30-01-2004 15:11 |
Trying to make buttons from my scripts | click101 | CorelDRAW/Corel DESIGNER VBA | 0 | 10-09-2003 10:41 |
How can I change middle colors in a custom Fountain Fill | Steve | CorelDRAW/Corel DESIGNER VBA | 3 | 13-12-2002 19:11 |