OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: zeeboy on August 07, 2009, 10:05:24 AM

Title: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 07, 2009, 10:05:24 AM
I love the Click event for labels and I'm using labels more dynamically now.  But I think it would be great to be able to have a label be larger vertically if there was a vertical justification property.

Thanks for all your great work!
Doug
Title: Re: Freature Request - Vertical Justification for Labels
Post by: owenwengerd on August 07, 2009, 12:00:38 PM
Can you give an example?
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 08, 2009, 01:34:27 PM
In the attached image file I've got a label "Not selected" next to a button.  I have the "Clicked" event for both the label and the button set and they both do the same "event" the user clicks on either.

If you were to implement the Vertical Justification for labels I would make my "Not selected" label vertically larger such that its height matches the height of the button adjacent.  This will just make it that much easier for the user to select either the label or the button.

This is not a huge "deal" for me.  Just a convenience request.

Thanks!
Doug
Title: Re: Freature Request - Vertical Justification for Labels
Post by: owenwengerd on August 08, 2009, 03:19:15 PM
Have you considered just making the label a button? If you make it a flat graphic button with no border, it should look just like a label, except the caption will be centered.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 08, 2009, 07:27:43 PM
I looked into using a Flat style Graphic Button but that doesn't have the Justification property for Left justification that I need.  I want the Horizontal justification and the Vertical. :)
Title: Re: Freature Request - Vertical Justification for Labels
Post by: owenwengerd on August 08, 2009, 09:33:06 PM
Gotcha. Another option is a picture box, which can have text drawn on it and behave like a button.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 10, 2009, 11:32:09 AM
Other than creating an image with the text value, how do you add text to a Picture box?
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 10, 2009, 11:34:01 AM
Looking into more it I'm guessing the Picturebox_DrawText method.  If that is indeed the way to go feel free to not reply.  I'll give my feedback once I implement it.

Thanks!
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 10, 2009, 01:59:42 PM
I think this will work but I'm having the hardest time getting the example in Methods.odcl to work!  I've copied the example code and changed the control to mine but I still can't get it to return T with dcl_PictureBox_DrawText or dcl_PictureBox_DrawWrappedText.

(dcl_PictureBox_Clear psMakeTyp-MkTyp_pctrbxInsPnt) returns T though.

Any suggestions?
Title: Re: Freature Request - Vertical Justification for Labels
Post by: owenwengerd on August 10, 2009, 02:39:09 PM
If you can post your code, perhaps someone can spot the error.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 10, 2009, 06:53:05 PM
      (dcl_PictureBox_Clear psMakeTyp-MkTyp_pctrbxInsPnt)
      (dcl_PictureBox_DrawText
        psMakeTyp-MkTyp_pctrbxInsPnt
        (list
          (list 10 10 -19 20 st%insertion_point_helper "TL")
        )
      )
      (dcl_PictureBox_DrawWrappedText
        psMakeTyp-MkTyp_pctrbxInsPnt
        (list
          (list 10 10 220 -19 "This sample text is supposed to wrap around if the width of the text is going to exceed the allowed width given." "L")
        )
      )

I got most of it from the Methods.lsp sample code.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: Kerry on August 10, 2009, 07:10:36 PM

ZEEBOY,
I think posting a (minimal ) sample form and (minimal) control code may make it easier for someone to attend to your error.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: owenwengerd on August 10, 2009, 08:31:07 PM
Your code looks fine. Are you calling this code from your form's OnInitialize event? If so, that is the reason. The DrawXXX functions draw directly onto the display memory, so they fail when the picture box is not visible. In OnInitialize, it is not yet visible. Try drawing the text in the picture box control's OnPaint handler instead.
Title: Re: Freature Request - Vertical Justification for Labels
Post by: zeeboy on August 11, 2009, 10:46:11 AM
I did have the code in the OnInitialize event and after using the Paint event on the Picture Box control everything works as initially desired.

THANKS!!!

I would still like to see the Vertical Justification added to Label controls.  They are much easier and faster to work with than this process for the Picture Box control. :)
Title: Re: Freature Request - Vertical Justification for Labels
Post by: Fred Tomke on August 13, 2009, 11:26:03 PM
Hi, zeeboy,

would you be so kind to add a screenshot with the result of using DrawText? I'd like to see the difference 'cause it sounds interesting.
Thanks!

Fred