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
Can you give an example?
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
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.
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. :)
Gotcha. Another option is a picture box, which can have text drawn on it and behave like a button.
Other than creating an image with the text value, how do you add text to a Picture box?
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!
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?
If you can post your code, perhaps someone can spot the error.
(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.
ZEEBOY,
I think posting a (minimal ) sample form and (minimal) control code may make it easier for someone to attend to your error.
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.
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. :)
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