Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ändert das Attribut für den angegebenen Schemaindex color im Farbschema des angegebenen Fensters in das neue Attribut attr.
void _WSetAttr(WHANDLE wh, int color, int attr)
WHANDLE wh; /* Window handle. */
int color; /* Color scheme. */
int attr; /* Attribute. */
Beispiel
Im folgenden Beispiel legt _WSetAttr( ) die Stiftfarbe nacheinander auf alle Farben der Farbschemata fest und zeigt anschließend Text in den einzelnen Farben an.
Visual FoxPro-Code
SET LIBRARY TO WSETATTR
C-Code
#include <pro_ext.h>
void putLong(long n, int width)
{
Value val;
val.ev_type = 'I';
val.ev_long = n;
val.ev_width = width;
_PutValue(&val);
}
FAR WAttrEx(ParamBlk FAR *parm)
{
int scheme;
int color;
WHANDLE wh;
int attrib, savePen;
for (scheme = 0; scheme <= 25; scheme++)
{
wh = _WOpen(2,10,23,70,WEVENT,scheme,(Scheme FAR *)0,
WO_SYSTEMBORDER);
for (color = WA_NORMAL; color <= WA_ISSHADOW; color++)
{
attrib = _WAttr(wh, color);
savePen = _WAttr(_WGetPort(), WA_PENCOLOR);
_WSetAttr(_WGetPort(), WA_PENCOLOR, attrib);
_PutStr("\nScheme:"); putLong(scheme, 5);
_PutStr("; Color:"); putLong(color, 5);
_PutStr("; Attribute byte:"); putLong(attrib, 5);
_WSetAttr(_WGetPort(), WA_PENCOLOR, savePen);
}
_WClose(wh);
_Execute("WAIT");
}
}
FoxInfo myFoxInfo[] = {
{"ONLOAD", (FPFI) WAttrEx, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
Siehe auch
_WClear( ), API-Bibliotheksroutine | _WClearRect( ), API-Bibliotheksroutine | _WAttr( ), API-Bibliotheksroutine | _PutStr( ), API-Bibliotheksroutine