Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2005.10.30;
Скачать: [xml.tar.bz2];

Вниз

нужны константы, а кто-то мелкий забыл их положить...   Найти похожие ветки 

 
Владимир Кладов   (2005-03-02 16:29) [0]

В общем разрабатываю я сейчас граф. контролы для KOL, круче чем то что есть в VCL: при очень небольшом коде (сравнивая с VCL конечно - 40К экзешник без сжатия это вроде неплохо), несложно оказалось сделать грф. контролы имитирующие не только label но и checkbox/radiobox/editbox/button, причем ни внешне ни по поведению от настоящих они ничем не отличаются. НО. Дошел я до рисования их с использованием менеджера тем ХР - специально для варианта с темами, и обнаружил что констант, весело описанных в MSDN, нигде почемуто не наличиствует, ни в файлеце uxtheme.h, ни еще где-либо. Может у кого есть новая (новейшая?) версия Delphi2005/VC++2005/MSDN2005 или еще что-то в этом роде? Признак того, что это "оно" - должны быть константы BP_CHECKBOX и CBS_CHECKBOXNORMAL как минимум (хотя эти две и еще с десяток я вычислил как раз). А мне по большому счету надо бы еще более подробное описание DrawThemeText (что за флаги 1 и 2 хотя бы), и OpenThemeData - конкретно, как называются темы для вских там кнопок. Не угадывать же их тоже...


 
ECM ©   (2005-03-02 16:42) [1]

DrawThemeText Function

--------------------------------------------------------------------------------

Draws text using the color and font defined by the visual style.

Syntax

HRESULT DrawThemeText(          HTHEME hTheme,
   HDC hdc,
   int iPartId,
   int iStateId,
   LPCWSTR pszText,
   int iCharCount,
   DWORD dwTextFlags,
   DWORD dwTextFlags2,
   const RECT *pRect
);
Parameters

hTheme
[in] Handle to a window"s specified theme data. Use OpenThemeData to create an HTHEME.
hdc
[in] Handle to a device context (HDC) to use for drawing.
iPartId
[in]  Value of type int that specifies the part that contains the text. See Parts and States.
iStateId
[in] Value of type int that specifies the state of the part. See Parts and States.
pszText
[in] Pointer to a string that contains the text to draw.
iCharCount
[in] Value of type int that contains the number of characters to draw. If the parameter is set to -1, all the characters in the string are drawn.
dwTextFlags
[in] DWORD that contains one or more values that specify the string"s formatting. See Format Values for possible parameter values.
dwTextFlags2
[in] The value for this flag is:
DTT_GRAYED 0x1
Draws a grayed-out string. This flag may be set to NULL.
pRect
[in] Pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the text is to be drawn.
Return Value

Returns S_OK if successful, or an error value otherwise.

Function Information

Stock Implementation UxTheme.dll
Custom Implementation No
Header uxtheme.h
Import library UxTheme.lib
Minimum operating systems Windows XP

See Also

Property Type Definitions

--------------------------------------------------------------------------------

© 2003 Microsoft Corporation. All rights reserved.


 
ECM ©   (2005-03-02 16:49) [2]

Format Values

--------------------------------------------------------------------------------

This section lists the values that are used with the dwTextFlags parameter of the DrawThemeText function. One or more of these values are used to specify how a text string should be formatted. The text string is drawn inside a display rectangle. The dimensions of the display rectangle are specified by the pRect parameter of the function.

Format Values
The following table lists the format values.

Value Description
DT_BOTTOM Renders the text string at the bottom of the display rectangle. This value is used only with the DT_SINGLELINE value.
DT_CALCRECT Determines the width and height of the display rectangle.
DT_CENTER Centers text horizontally in the display rectangle.
DT_EDITCONTROL Duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
DT_END_ELLIPSIS Truncates a text string that is wider than the display rectangle and adds an ellipsis to indicate the truncation. The string is not modified unless the DT_MODIFYSTRING flag is specified.
DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. The DT_WORD_ELLIPSIS, DT_PATH_ELLIPSIS, and DT_END_ELLIPSIS values cannot be used with the DT_EXPANDTABS value.
DT_EXTERNALLEADING Includes the external leading of a font in the line height. Normally, external leading is not included in the height of a line of text.
DT_HIDEPREFIX Ignores the prefix character & in the text. The letter that follows is not underlined, but other prefix characters are still processed. For example:

input string: "A&bc&&d"

normal: "Abc&d"

DT_HIDEPREFIX: "Abc&d"

DT_LEFT Aligns text to the left.
DT_MODIFYSTRING Modifies a string to match the displayed text. This value has no effect unless DT_END_ELLIPSIS or DT_PATH_ELLIPSIS is specified.
DT_NOCLIP Draws the text string without clipping the display rectangle.
DT_NOFULLWIDTHCHARBREAK Prevents a line break at a double-byte character set (DBCS), so that the line-breaking rule is equivalent to single-byte character set (SBCS). This can be used, for example, to make icon labels written in Korean text more readable. This value has no effect unless DT_WORDBREAK is specified.
DT_NOPREFIX Turns off processing of prefix characters. Normally, DrawThemeText interprets the prefix character & as a directive to underscore the character that follows, and the prefix characters && as a directive to print a single &. By specifying DT_NOPREFIX, this processing is turned off. For example:

input string: "A&bc&&d"

normal: "Abc&d"

DT_NOPREFIX: "A&bc&&d"

DT_PATH_ELLIPSIS Replaces characters in the middle of text with an ellipsis so that the result fits in the display rectangle. If the string contains backslash (\) characters, DT_PATH_ELLIPSIS preserves as much as possible of the text after the last backslash. The string is not modified unless the DT_MODIFYSTRING flag is specified.
DT_PREFIXONLY Draws only an underline at the position of the character following the prefix character &. Normally DrawThemeText interprets the & as a directive to underline the character that follows and the prefix characters && as a directive to print a single &. By specifying DT_PREFIXONLY, no characters are drawn, only an underline. White spaces are placed in the positions where characters would normally appear. For example:

input string: "A&bc&&d"

normal: "Abc&d"

DT_PREFIXONLY: " _   "

DT_RIGHT Aligns text to the right.
DT_RTLREADING Lays out text in right-to-left order for bidirectional text, for example, text in a Hebrew or Arabic font. The default direction for text is left-to-right.
DT_SINGLELINE Displays text on a single line. Carriage returns and line feeds do not break the line.
DT_TABSTOP Sets tab stops.
DT_TOP Renders the text at the top of the display rectangle.
DT_VCENTER Centers text vertically. This value is used only with the DT_SINGLELINE value.
DT_WORDBREAK Breaks lines between words if a word would extend past the edge of the display rectangle. A carriage return/line feed (CR/LF) sequence also breaks the line.
DT_WORD_ELLIPSIS Truncates any word that does not fit in the display rectangle and adds an ellipsis.

--------------------------------------------------------------------------------

© 2003 Microsoft Corporation. All rights reserved.


 
ECM ©   (2005-03-02 16:54) [3]

Parts and States

--------------------------------------------------------------------------------

To add visual styles to your applications you use the Theme API. This topic discusses the theme parts and states that you use to change the appearance of controls. Controls and windows have parts that Microsoft® Windows® draws. These are divided into parent and child parts. Most parts have a state—for example disabled, active, or selected. When you create a control, you decide which parts of the control to apply visual styles to. You divide the control into a main part and zero or more named, child parts. Examples of parts are text areas, drawn shapes, images, and lines. For each part, you can define one or more background images in a single bitmap file. The different backgrounds are usually associated with different states of the control, but do not have to be. For example, if the control is disabled, a grayed background might be used. At run time, the appropriate image can be selected by using an iStateId value as the 1-based index to the correct image.

Parts and States of Standard Controls and Windows
The following table shows how the common controls are broken into parts and states.

Control Part States
BUTTON BP_CHECKBOX CBS_CHECKEDDISABLED, CBS_CHECKEDHOT, CBS_CHECKEDNORMAL, CBS_CHECKEDPRESSED, CBS_MIXEDDISABLED, CBS_MIXEDHOT, CBS_MIXEDNORMAL, CBS_MIXEDPRESSED, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDHOT, CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDPRESSED
BP_GROUPBOX GBS_DISABLED, GBS_NORMAL
BP_PUSHBUTTON PBS_DEFAULTED, PBS_DISABLED, PBS_HOT, PBS_NORMAL, PBS_PRESSED  
BP_RADIOBUTTON RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDNORMAL, RBS_CHECKEDPRESSED, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDHOT, RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDPRESSED  
BP_USERBUTTON  
CLOCK CLP_TIME CLS_NORMAL
COMBOBOX CP_DROPDOWNBUTTON CBXS_DISABLED, CBXS_HOT, CBXS_NORMAL, CBXS_PRESSED
EDIT EP_CARET  
EP_EDITTEXT ETS_ASSIST, ETS_DISABLED, ETS_FOCUSED, ETS_HOT, ETS_NORMAL, ETS_READONLY, ETS_SELECTED
EXPLORERBAR EBP_HEADERBACKGROUND  
EBP_HEADERCLOSE EBHC_HOT, EBHC_NORMAL, EBHC_PRESSED
EBP_HEADERPIN EBHP_HOT, EBHP_NORMAL, EBHP_PRESSED, EBHP_SELECTEDHOT, EBHP_SELECTEDNORMAL, EBHP_SELECTEDPRESSED
EBP_IEBARMENU EBM_HOT, EBM_NORMAL, EBM_PRESSED
EBP_NORMALGROUPBACKGROUND  
EBP_NORMALGROUPCOLLAPSE EBNGC_HOT, EBNGC_NORMAL, EBNGC_PRESSED
EBP_NORMALGROUPEXPAND EBNGE_HOT, EBNGE_NORMAL, EBNGE_PRESSED
EBP_NORMALGROUPHEAD  
EBP_SPECIALGROUPBACKGROUND  
EBP_SPECIALGROUPCOLLAPSE EBSGC_HOT, EBSGC_NORMAL, EBSGC_PRESSED
EBP_SPECIALGROUPEXPAND EBSGE_HOT, EBSGE_NORMAL, EBSGE_PRESSED
EBP_SPECIALGROUPHEAD
<...>


 
Владимир Кладов   (2005-03-02 17:11) [4]

спасибо, это у меня есть. Цифры нужны, которые всем этим константам соответствуют


 
ECM ©   (2005-03-02 17:14) [5]

The Tmschema.h file defines the enumerated types and type definitions used in Microsoft® Windows® Themes.
У меня он есть - выслать?


 
Владимир Кладов   (2005-03-02 17:18) [6]

да. конечно. разумеется. это именно я и  хотел :)


 
ECM ©   (2005-03-02 17:40) [7]

http://kolibdb.100free.com/MsShema.zip
Это все, что я успел накопать по этому вопросу :)



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2005.10.30;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.48 MB
Время: 0.054 c
14-1129023517
dr Tr0jan
2005-10-11 13:38
2005.10.30
Помогите вспомнить название и исполнителя композиции.


4-1124648013
SpyBoy
2005-08-21 22:13
2005.10.30
NtOpenFile


1-1128748195
Gefest80
2005-10-08 09:09
2005.10.30
Реестр!


3-1127094224
DimonS
2005-09-19 05:43
2005.10.30
Как правильно сложить несколько полей?


14-1128519629
oldman
2005-10-05 17:40
2005.10.30
Иногда бывает так, как не бывает...





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский