A bevelline with horizontal and vertical text

The class described here replaces my former issue cdxCBevelLine.
This class provides the following options:

rotated_bevel.gif (5061 Byte)

Features:
  • A bevel line even if user has strange fonts
    (have you ever created a sunken static with a height of 1 for a bevelline and tested your program on a machine that has 200% larger fonts ?).
  • Text rotates appropiately (usable with any font).
  • Reacts properly on WM_ENABLEWINDOW.
  • Might be used as an example for my cdxCRot90DC (which you may find in the misc section of codeguru's).

How to use (in a dialog):

  1. Add cdxCRotBevelLine.h, cdxCRotBevelLine.cpp, cdxCRot90DC.h and cdxCRot90DC.cpp to your project.
  2. Add a static control to your dialog resource.
    Enter some appropiate text to it.
    If your static's width is greater than its height the bevelline will appear horizontal, vertical otherwise.
    If the bevelline is drawn vertically, the text is rotated by 900 degrees by default (left hand examples of upper image).
    To modify this, put a "~" in front of your control text (right hand bevels in the upper image).
  3. Change its ID to something like IDC_BEVEL_1, open classwizard and assign a member variable, type control (CStatic) to it ("m_wndBevel1" for example).
  4. Open your dialog class' header file.
    Add #include "cdxCRotBevelLine.h".
    Find the line "CStatic m_wndBevel1;" and replace the "CStatic" by "cdxCRotBevelLine".
  5. Compile and run.

Notes:

  • This class may even be useful to you if you only need horizontal bevels.
    Some people mentioned that it's enough to create a sunken static with a height of 1 (use Alt while sizing the control) and to put another text control over it.
    In fact, this will look really strange if the user choosed big fonts for his display - the dialog resource will automatically adapt the the newly found font and your height of 1 may become 3 or stuff - and suddenly friend user doesn't have a bevelline but a sunken static.

Files:

Download demo project - 52 KB

Download source - 30 KB



Comments

  • Note about Win95,98,CE and PlgBlt

    Posted by Legacy on 01/08/2000 12:00am

    Originally posted by: Brian V Shifrin

    I like your code, but ....

    To everyone who trying to run it on Windows 95,98 or CE
    text rotation will not work.

    Trouble with PlgBlt. This API only supported on NT and 2000.

    Platforms SDK lists PlgBlt as
    Windows 95/98: Unsupported.
    Windows CE: Unsupported.

    You should only see horizontal labels where BitBlt is used instead of PlgBlt.

    Reply
  • rotate doesn't work

    Posted by Legacy on 04/06/1999 12:00am

    Originally posted by: Mike Wild

    I tried the sample and the rotated text isn't shown on WIN 95 with VC 6.0


    Mike

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Hybrid cloud platforms need to think in terms of sweet spots when it comes to application platform interface (API) integration. Cloud Velocity has taken a unique approach to tight integration with the API sweet spot; enough to support the agility of physical and virtual apps, including multi-tier environments and databases, while reducing capital and operating costs. Read this case study to learn how a global-level Fortune 1000 company was able to deploy an entire 6+ TB Oracle eCommerce stack in Amazon Web …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds