Freature Request - Vertical Justification for Labels

Started by zeeboy, August 07, 2009, 10:05:24 AM

Previous topic - Next topic

zeeboy

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
don't complain if you're not going to do something about it.

owenwengerd


zeeboy

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
don't complain if you're not going to do something about it.

owenwengerd

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.

zeeboy

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. :)
don't complain if you're not going to do something about it.

owenwengerd

Gotcha. Another option is a picture box, which can have text drawn on it and behave like a button.

zeeboy

Other than creating an image with the text value, how do you add text to a Picture box?
don't complain if you're not going to do something about it.

zeeboy

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!
don't complain if you're not going to do something about it.

zeeboy

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?
don't complain if you're not going to do something about it.

owenwengerd

If you can post your code, perhaps someone can spot the error.

zeeboy

      (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.
don't complain if you're not going to do something about it.

Kerry


ZEEBOY,
I think posting a (minimal ) sample form and (minimal) control code may make it easier for someone to attend to your error.
Perfection is not optional.
My other home is TheSwamp

owenwengerd

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.

zeeboy

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. :)
don't complain if you're not going to do something about it.

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]