DCSAY with SAYSIZE 0, x

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

DCSAY with SAYSIZE 0, x

#1 Post by Markus Walter »

Hello,

i have a problem. I always use SAYSIZE 0, x with DCSAY, because i want to have the automatic width for the DCSAY. Unfortunately the height of the DCSAY is also automatic set in this case. Is there a posibility to have only the automatic for the width?

This sample shows my problem:

Code: Select all

#include "dcdialog.ch"
#include "appevent.ch"

function Appsys()
return NIL

procedure main()
local getlist := {}, getoptions := {}, lRet, cVar := padr("Test", 20)

  @ 30, 20 DCSAY "TestTest" SAYSIZE 0, 42 SAYFONT "22.MS Sans Serif" SAYVCENTER SAYCOLOR {|| { , GRA_CLR_RED} }
  @ 30, 140 DCGET cVar GETSIZE 300, 42 GETFONT "22.MS Sans Serif"

  DCGETOPTIONS TITLE "Test" PIXEL
  DCREAD GUI TO lRet OPTIONS getoptions ADDBUTTONS FIT

RETURN
I want to have the DCSAY V-Centered in the same height as the SLE.

The attachment show my problem as a screenshot.
Attachments
SAYVCENTER.png
SAYVCENTER.png (29.21 KiB) Viewed 9794 times
-----------------
Greetings
Markus Walter

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCSAY with SAYSIZE 0, x

#2 Post by rdonnay »

try this:

Code: Select all

@ .. dcsay .. get .. sayeval {|o|CenterSay(o)}


FUNCTION CenterSayOnGet(oSay)

oSay:setPos( {oSay:currentPos()[1], oSay:currentPos()[2] + 4})

RETURN nil
The eXpress train is coming - and it has more cars.

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: DCSAY with SAYSIZE 0, x

#3 Post by Markus Walter »

Hi Roger,

i am looking for a generic solution. I can't use your sample for several reasons. Can you give me a hint, where i found your width calculation for the dcsay? Then i will calc the width myself and not use "Size 0"...
-----------------
Greetings
Markus Walter

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCSAY with SAYSIZE 0, x

#4 Post by Tom »

@Markus: Create a subclass and do it there.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCSAY with SAYSIZE 0, x

#5 Post by rdonnay »

@Markus: Create a subclass and do it there
Why didn't I think of that?
:oops:
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: DCSAY with SAYSIZE 0, x

#6 Post by Auge_Ohr »

Markus Walter wrote:The attachment show my problem as a screenshot.
while are using Win7 the (need) +4 is "Borderpadding".

Code: Select all

#define SM_CXPADDEDBORDER       92 

   If VAL( OS(OS_VERSION) ) > 5
      ::nPadding     := @USER32:GetSystemMetrics(SM_CXPADDEDBORDER) // using ot4xb Syntax
   ELSE
      ::nPadding     := 0
   ENDIF
greetings by OHR
Jimmy

Post Reply