OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26-02-2005, 13:07
zlatev
Guest
 
Posts: n/a
Default Retrieve names list of constants in a given enumeration

Is there a way to get an array with names of the constants that are in a given corel VBA enumeration.
For example for cdrUnit to recieve array with string values (names of the constants, not their values) like:

Code:
cdrTenthMicron, cdrInch, cdrFoot, cdrMillimeter, cdrCentimeter, cdrPixel, cdrMile, cdrMeter, cdrKilometer, cdrDidots, cdrAgate, cdrYard, cdrPica, cdrCicero, cdrPoint, cdrUnitQ, cdrUnitH
Even more I would like if it can have some-kind of user friendly names for this constants. (e.g. Inch instead of cdrInch)
Like it is in combobox near to the width spinbuton in Layout | Page Setup | Document | Page | Size

Well if there is no standard way I would write them by hand, in that case I just need confirmation that there is no way :roll:

Question is for CorelDraw 12 VBA

____

Also what kind of measures are cdrTenthMicron and cdrAgate?
Reply With Quote
  #2  
Old 27-02-2005, 11:07
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Retrieve names list of constants in a given enumeration

Quote:
Originally Posted by zlatev
Is there a way to get an array with names of the constants that are in a given corel VBA enumeration.
No, the easiest way is just to create your own array of strings and then do the mapping.

Quote:
Also what kind of measures are cdrTenthMicron and cdrAgate?
cdrTenthMicron is the internal unit of CorelDRAW. Hmm, I just realize something. The constant name should read "cdrTensOfMicron" and not cdrTenthMicron. One unit is actually 10 microns. 1 mm equals to 10,000 of these units.

1 agate = 1/14 inches.
Reply With Quote
  #3  
Old 27-02-2005, 13:35
zlatev
Guest
 
Posts: n/a
Default Layout | Page Setup | Document | Page | Size - Units

One slightly related to this issue problem.
How to retrieve the current setting made of user for measurement units on page (See Layout | Page Setup | Document | Page | Size or Property Bar when there is no selection)?
I tried ActiveDocument.Unit and Application.Unit also but they always give me cdrInch, no matter what I have selected in the combo.
The ugly thing is that I am actually with Bulgarian regional settings (metric system) so I don't have idea where this "inch" comes from.
Reply With Quote
  #4  
Old 27-02-2005, 15:30
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Layout | Page Setup | Document | Page | Size - Units

The Unit property of both Document and Application objects are VBA-only properties and used only to specify the units of various VBA methods and their parameters (such as Layer.CreateRectangle). What you want to get is the ruler units. You can get to them using Document.Rulers.HUnits and Document.Rulers.VUnits properties.

Hope this helps.
Reply With Quote
  #5  
Old 27-02-2005, 15:37
zlatev
Guest
 
Posts: n/a
Default

Well it seems that this setting is actually the measurement unit for the horizontal ruler.
Thank you.
Reply With Quote
  #6  
Old 09-02-2009, 20:12
m31uk3
Guest
 
Posts: n/a
Default

Corel is for sure funny here!

I can't find where the inches come from either...

To make it even more funny the cdrUnit numbers do not correspond to the XRulerUnits stored in the registry under HKEY_CURRENT_USER\Software\Corel\CorelDRAW\13.0\CorelDRAW\Application Preferences\Ruler and Grid Settings

So anyhow Corel Units are easily the most mind boggling I've ever dealt with..


Code:
 Dim Draw As CorelDRAW.Application
    
    Set Draw = New CorelDRAW.Application
    'Draw.Unit = cdrMillimeter
    Debug.Print Draw.Unit
    Debug.Print Draw.ActiveDocument.Unit
    Debug.Print Draw.ActiveDocument.Rulers.HUnits
    
        'Get user's unit pref from registry
    Debug.Print CorelScriptTools.RegistryQuery(1, "Software\Corel\CorelDRAW\13.0\CorelDRAW\Application Preferences\Ruler and Grid Settings", "XRulerUnits")

Best,
m31uk3

Last edited by m31uk3; 09-02-2009 at 20:17.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
List names of files located in a folder RVogel CorelDRAW/Corel DESIGNER VBA 1 31-03-2005 16:14


All times are GMT -5. The time now is 11:36.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com