Hello, all
I have been looking into polishing up some of my macro stuff by properly reacting to document settings and such and prettied something that was built for everyday use. It's a simple little tag adding tool:
To try it out just download the attached zip and extract the GMS file into: C:\Users\YOUR USERNAME\APPDATA\Roaming\Corel\CorelDRAW Graphics Suite X6\Draw\GMS
Then in CD go to Tools ==> Macros ==> Macro manager and launch the ShowForm bit.
If you have a document open and a shape selected it should work just fine.
As can be seen some more options are in store - if you have any suggestions, feel free to share.
Hi.
Pretty Cool. Let's build on it
Options to have tag say Color or size?
Nice work!
~John
Thanks, John!!
Sub GDG_John( ) said:Options to have tag say Color or size?
I do plan to add sizing (as indicated by disabled buttons) - it would work the same easy way - just press to read in sizes, add comments if needed and insert neat, readable arrows.
Color - now that's a cool idea!
joe said: Thanks, John!! Options to have tag say Color or size? I do plan to add sizing (as indicated by disabled buttons) - it would work the same easy way - just press to read in sizes, add comments if needed and insert neat, readable arrows. Color - now that's a cool idea! [/quote] Hi. I mean the ability to put color value in Tags. IE GREEN : CMYK 100,100,0,0 This sure brings up a lot of possibilities : Also would be nice to save the last text used so when macro is restarted it remembers last settings. Perhaps a form popup with simple list box of all last typed strings. Double clicking the text in the list box closes the listbox with the form pop up and puts text in text field. Put a little icon next to each text field that makes the form pop up. ~John
[/quote]
I mean the ability to put color value in Tags. IE GREEN : CMYK 100,100,0,0
This sure brings up a lot of possibilities :
Also would be nice to save the last text used so when macro is restarted it remembers last settings.
Perhaps a form popup with simple list box of all last typed strings. Double clicking the text in the list box closes the listbox with the form pop up and puts text in text field. Put a little icon next to each text field that makes the form pop up.
Sub GDG_John( ) said:I mean the ability to put color value in Tags. IE GREEN : CMYK 100,100,0,0
I got that, which is the reason I think it's a great idea :)
Sub GDG_John( ) said:Also would be nice to save the last text used so when macro is restarted it remembers last settings.
The registry settings and form element interactions are always a tripping stone for me for some reason. I'm slowly moving through your training videos to become better, though.
Will look into what can be done.
How I have been doing it lately, at least for text fields and form option, is to put savesetting in the form controls change event. Just remember that when you open the form and retrieve settings in the userform init sub, the change to the value will cause the change event code to run.
I put a bNoEvents Boolean at module level in the form code.
In the User Form Init start by putting bNoEvents to True and end putting it back to false. In each change event place If bNoEvents the Exit Sub
At least that's how I figured has been working well. Maybe others have a different way.
Option ExplicitDim bNoEvents As Boolean
Private Sub UserForm_Initialize()
bNoEvents = True chkBoxForVal1 = CBool(GetSetting(MACRONAME, "Pref_" & VersionMajor, "chkVal1", False))
bNoEvents = False End Sub
Private Sub chkBoxForVal1 _Click() If bNoEvents Then Exit Sub SaveSetting MACRONAME, "Pref_" & VersionMajor, "chkVal1", CBool(chkBoxForVal1)End Sub
I think I got it - in the case of a textbox, for example, it would be OnChange instead of click for the 2nd sub, right?
Although I'd prefer to save the text on form close, probably.
Another option to add might be a font selection and background/foreground color. Speaking of which (fonts) - I did your font picker example and for some reason 9 times out of 10 CD wouldn't populate the font list fully. Arial would be missing, along with 2/3 of other fonts. Rather weird.
joe said:Although I'd prefer to save the text on form close, probably.
If you do this then no need for the events or the bNoEvents Boolean. Yes, whatever event you want, can be change, or click or the checkboxes and option buttons.
I used to do it like this and just put a little sub called sms (save my settings) which runs at the end of the command button click sub that runs the main macro function.
Not sure what going on there with the fonts. Seems to work great here.I really like it now because it doesn't group things like the new update 4.
You could also:
Sub updateFontList() ForceUpdateFontTableEnd Sub
Alright, thanks to John's advice I have updated the tool with saving of last used values as well as its position.
Also you get the fairly neat dimension lines - the benefit being their clean appearance and easy setup (Press Get to get the values from a current selection) :
Feel free to suggest line ending styles should you want them.
There's also (partially finished) Fill color insertion.
That's looking sweet!
Cool. I was thinking of putting size in a tag, not dimensions. There are already many dimensioning macros.
A fast way to note size in a simple tag, rather than putting dimensions, would be new and keep the theme of the macro together.
Well, it's up to you - you can put the size info you get into a tag - or you can put some text on a dimension line.
I prefer this style of dimensioning for client previews - it's quick and easy and looks clean and readable, hence the function.
Came back from a bunch of work-related trips and finally added some extra options to this little tool. You can now pick which fields get filled in when you use the corresponding buttons and also there's a decimals setting for precision. Here' s a handy demonstration GIF of it in action: