CToolBar and/or CDialogBar
-
Greetings all! I'd like to create a bar which will have a mixture of the tool buttons and controls (combo, pushbutton, edit, etc). The CToolBar class will work for the tool buttons but the job of implementing the controls is too involved. The CDialogBar class will work for the controls but how do I get the tool buttons to work? I've tried a standard button with the BS_ICON style; two problems: 1) button is 16x16, icon is 16x16 but the display lops off part of the icon and 2) how do I get the button to stay "depressed"? I've tried a standard button with the BS_BITMAP style but it: 1) loses the 'transparency' feature of icons, and 2) I still cannot get the button to stay "depressed". The BS_PUSHLIKE style does cause the button to appear to be pushed in on mouse click but does not remain pushed in. The CReBar class will allow for the wrapping of a CToolBar in one band and the CDialogBar in another band but I'd really like to mix the tool buttons and controls in a more logical order. So, the upshot is, I'd like to use the CDialogBar with BS_ICON style if the following problems can be fixed: 1) how do I display the full (standard sized) icon? 2) how do I simulate the icon being "depressed"? Regards, Kylur.
-
Greetings all! I'd like to create a bar which will have a mixture of the tool buttons and controls (combo, pushbutton, edit, etc). The CToolBar class will work for the tool buttons but the job of implementing the controls is too involved. The CDialogBar class will work for the controls but how do I get the tool buttons to work? I've tried a standard button with the BS_ICON style; two problems: 1) button is 16x16, icon is 16x16 but the display lops off part of the icon and 2) how do I get the button to stay "depressed"? I've tried a standard button with the BS_BITMAP style but it: 1) loses the 'transparency' feature of icons, and 2) I still cannot get the button to stay "depressed". The BS_PUSHLIKE style does cause the button to appear to be pushed in on mouse click but does not remain pushed in. The CReBar class will allow for the wrapping of a CToolBar in one band and the CDialogBar in another band but I'd really like to mix the tool buttons and controls in a more logical order. So, the upshot is, I'd like to use the CDialogBar with BS_ICON style if the following problems can be fixed: 1) how do I display the full (standard sized) icon? 2) how do I simulate the icon being "depressed"? Regards, Kylur.
- set BS_OWNERDRAW style, and draw yourself in CButton::DrawItem overridden function (you need in this case to create your own class derived from CButton), or an easier alternative is to use CBitmapButton class.
- add BS_AUTOCHECKBOX and BS_PUSHLIKE styles.
Ovidiu Cucu Microsoft MVP - Visual C++
-
- set BS_OWNERDRAW style, and draw yourself in CButton::DrawItem overridden function (you need in this case to create your own class derived from CButton), or an easier alternative is to use CBitmapButton class.
- add BS_AUTOCHECKBOX and BS_PUSHLIKE styles.
Ovidiu Cucu Microsoft MVP - Visual C++