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 06-04-2011, 22:25
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 147
Default scale caption - dockers reset caption

This is strange. Would you test this please?
This code will show the worldscale in the caption (Thanks Shelby/John).
When click on docker (eg. contour, scrapbook, fillet/chamfer) the caption is lost. Help please.

Code:
Sub ScaleCaption()
    Dim NewCaption As String
    Dim lngVersion As Long
    Dim strVersion As String, strWorldScale As String
    
    If Not ActiveDocument Is Nothing Then
        lngVersion = Application.VersionMajor
        Select Case lngVersion
            Case 13
                strVersion = "X3"
            Case 14
                strVersion = "X4"
            Case 15
                strVersion = "X5"
            Case Else
                strVersion = CStr(lngVersion)
        End Select
        
        Select Case ActiveDocument.WorldScale
            Case 1
                strWorldScale = "1"" = 1"""
            Case 2
                strWorldScale = "Half"
            Case 4
                strWorldScale = "3"" = 1'"
            Case 8
                strWorldScale = "1-1/2"" = 1'"
            Case 12
                strWorldScale = "1"" = 1'"
            Case 16
                strWorldScale = "3/4"" = 1'"
            Case 24
                strWorldScale = "1/2"" = 1'"
            Case 32
                strWorldScale = "3/8"" = 1'"
            Case 48
                strWorldScale = "1/4"" = 1'"
            Case 64
                strWorldScale = "3/16"" = 1'"
            Case 96
                strWorldScale = "1/8"" = 1'"
            Case 128
                strWorldScale = "3/32"" = 1'"
            Case Else
                strWorldScale = ActiveDocument.WorldScale
        End Select
        NewCaption = "CorelDRAW " & strVersion & " ¨'¨l¨'¨ " & strWorldScale
        If AppWindow.Caption <> NewCaption Then AppWindow.Caption = NewCaption
    End If
End Sub
*UPDATE - This happens when you fold-out (expand) a docker.

Last edited by gorgo; 06-04-2011 at 22:27.
Reply With Quote
  #2  
Old 07-04-2011, 07:36
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 808
Default

Hi.
Yes. In order to retain the caption throughout program use you will have to trigger this sub with an event. Most likely SelectionChange.
-John
Reply With Quote
  #3  
Old 07-04-2011, 21:56
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 147
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
Yes. In order to retain the caption throughout program use you will have to trigger this sub with an event. Most likely SelectionChange.
-John
Interesting...care to show me how please?
Reply With Quote
  #4  
Old 08-04-2011, 08:31
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 808
Default

Hi.
In the ThisMacroStorage module for the project put

Code:
Private Sub GlobalMacroStorage_SelectionChange()
    YourModuleName.ScaleCaption
End Sub
where YourModuleName is the name of the module with the ScaleCaption code.

-John
Reply With Quote
  #5  
Old 08-04-2011, 22:56
gorgo2 gorgo2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 106
Default

good stuff.
it switches when docker is selected, but restores the scale caption upon selecting the drawing page. weird but that's much better than before.

Thanks much John.
__________________
Using: CorelDraw X4 (14.0.0.701)
OS: Windows XP Pro
Reply With Quote
  #6  
Old 09-04-2011, 08:39
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 808
Default

HI.
Yea. Anytime a selection is changed in the document this code is triggered. Don't put much in this event as it runs often.
-John
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
Reset the Scale Factor to 100% Hernán CorelDRAW/Corel DESIGNER VBA 18 12-05-2010 23:48
New X4 Custom Dockers bprice CorelDRAW/Corel DESIGNER VBA 4 21-07-2008 11:11
changing Caption bumblebee CorelDRAW/Corel DESIGNER VBA 6 13-12-2004 09:13
Label Caption Live Update ddonnahoe CorelDRAW/Corel DESIGNER VBA 10 09-04-2004 10:59
Reset the Scale Factor to 100% Hernán New product ideas 12 31-12-1969 18:32


All times are GMT -5. The time now is 02:24.


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