本文整理汇总了C++中IsEnabled函数 的典型用法代码示例。如果您正苦于以下问题:C++ IsEnabled函数的具体用法?C++ IsEnabled怎么用?C++ IsEnabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsEnabled函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: InitStalker
bool BattlefieldWG::SetupBattlefield()
{
InitStalker(BATTLEFIELD_WG_NPC_STALKER, WintergraspStalkerPos[0], WintergraspStalkerPos[1], WintergraspStalkerPos[2], WintergraspStalkerPos[3]);
m_TypeId = BATTLEFIELD_WG; // See enum BattlefieldTypes
m_BattleId = BATTLEFIELD_BATTLEID_WG;
m_ZoneId = BATTLEFIELD_WG_ZONEID;
m_MapId = BATTLEFIELD_WG_MAPID;
m_Map = sMapMgr->FindMap(m_MapId, 0);
m_Guid = MAKE_NEW_GUID((m_BattleId ^ 0x20000), 0, HIGHGUID_BATTLEGROUND);
m_MaxPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MAX);
m_IsEnabled = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE);
m_MinPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN);
m_MinLevel = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MIN_LVL);
m_BattleTime = sWorld->getIntConfig(CONFIG_WINTERGRASP_BATTLETIME) * MINUTE * IN_MILLISECONDS;
//m_NoWarBattleTime = sWorld->getIntConfig(CONFIG_WINTERGRASP_NOBATTLETIME) * MINUTE * IN_MILLISECONDS;
m_NoWarBattleTime = 10 * MINUTE * IN_MILLISECONDS;
m_RestartAfterCrash = sWorld->getIntConfig(CONFIG_WINTERGRASP_RESTART_AFTER_CRASH) * MINUTE * IN_MILLISECONDS;
m_TimeForAcceptInvite = 20;
m_StartGroupingTimer = 5 * MINUTE * IN_MILLISECONDS; //original was 15
m_StartGrouping = false;
m_tenacityStack = 0;
KickPosition.Relocate(5728.117f, 2714.346f, 697.733f, 0);
KickPosition.m_mapId = m_MapId;
RegisterZone(m_ZoneId);
m_Data32.resize(BATTLEFIELD_WG_DATA_MAX);
m_saveTimer = 60000;
// Init GraveYards
SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
// Load from db
if ((sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) == 0) && (sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) == 0)
&& (sWorld->getWorldState(ClockWorldState[0]) == 0))
{
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, uint64(false));
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, uint64(urand(0, 1)));
sWorld->setWorldState(ClockWorldState[0], uint64(m_NoWarBattleTime));
}
m_isActive = bool(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE));
m_DefenderTeam = TeamId(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER));
m_Timer = sWorld->getWorldState(ClockWorldState[0]);
if (m_isActive)
{
m_isActive = false;
m_Timer = m_RestartAfterCrash;
}
for (uint8 i = 0; i < BATTLEFIELD_WG_GRAVEYARD_MAX; i++)
{
BfGraveyardWG* graveyard = new BfGraveyardWG(this);
// When between games, the graveyard is controlled by the defending team
if (WGGraveYard[i].startcontrol == TEAM_NEUTRAL)
graveyard->Initialize(m_DefenderTeam, WGGraveYard[i].gyid);
else
graveyard->Initialize(WGGraveYard[i].startcontrol, WGGraveYard[i].gyid);
graveyard->SetTextId(WGGraveYard[i].textid);
m_GraveyardList[i] = graveyard;
}
// Spawn workshocreatures and gameobjects
for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++)
{
WGWorkshop* workshop = new WGWorkshop(this, i);
if (i < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
workshop->GiveControlTo(GetAttackerTeam(), true);
else
workshop->GiveControlTo(GetDefenderTeam(), true);
// Note: Capture point is added once the gameobject is created.
WorkshopsList.insert(workshop);
}
// Spawn NPCs in the defender's keep, both Horde and Alliance
for (uint8 i = 0; i < WG_MAX_KEEP_NPC; i++)
{
// Horde npc
if (Creature* creature = SpawnCreature(WGKeepNPC[i].entryHorde, WGKeepNPC[i].x, WGKeepNPC[i].y, WGKeepNPC[i].z, WGKeepNPC[i].o, TEAM_HORDE))
KeepCreature[TEAM_HORDE].insert(creature->GetGUID());
// Alliance npc
if (Creature* creature = SpawnCreature(WGKeepNPC[i].entryAlliance, WGKeepNPC[i].x, WGKeepNPC[i].y, WGKeepNPC[i].z, WGKeepNPC[i].o, TEAM_ALLIANCE))
KeepCreature[TEAM_ALLIANCE].insert(creature->GetGUID());
}
// Hide NPCs from the Attacker's team in the keep
for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr)
if (Creature* creature = GetCreature(*itr))
HideNpc(creature);
//.........这里部分代码省略.........
开发者ID:BravadoToDeath, 项目名称:ArkCORE-NG, 代码行数:101, 代码来源:BattlefieldWG.cpp
示例2: GetThumbRect
void CHorizontalLayoutUI::DoEvent(TEventUI& event)
{
if( m_iSepWidth != 0 ) {
if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() )
{
RECT rcSeparator = GetThumbRect(false);
if( ::PtInRect(&rcSeparator, event.ptMouse) ) {
m_uButtonState |= UISTATE_CAPTURED;
ptLastMouse = event.ptMouse;
m_rcNewPos = m_rcItem;
if( !m_bImmMode && m_pManager ) m_pManager->AddPostPaint(this);
return;
}
}
if( event.Type == UIEVENT_BUTTONUP )
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
m_uButtonState &= ~UISTATE_CAPTURED;
m_rcItem = m_rcNewPos;
if( !m_bImmMode && m_pManager ) m_pManager->RemovePostPaint(this);
NeedParentUpdate();
return;
}
}
if( event.Type == UIEVENT_MOUSEMOVE )
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
LONG cx = event.ptMouse.x - ptLastMouse.x;
ptLastMouse = event.ptMouse;
RECT rc = m_rcNewPos;
if( m_iSepWidth >= 0 ) {
if( cx > 0 && event.ptMouse.x < m_rcNewPos.right - m_iSepWidth ) return;
if( cx < 0 && event.ptMouse.x > m_rcNewPos.right ) return;
rc.right += cx;
if( rc.right - rc.left <= GetMinWidth() ) {
if( m_rcNewPos.right - m_rcNewPos.left <= GetMinWidth() ) return;
rc.right = rc.left + GetMinWidth();
}
if( rc.right - rc.left >= GetMaxWidth() ) {
if( m_rcNewPos.right - m_rcNewPos.left >= GetMaxWidth() ) return;
rc.right = rc.left + GetMaxWidth();
}
}
else {
if( cx > 0 && event.ptMouse.x < m_rcNewPos.left ) return;
if( cx < 0 && event.ptMouse.x > m_rcNewPos.left - m_iSepWidth ) return;
rc.left += cx;
if( rc.right - rc.left <= GetMinWidth() ) {
if( m_rcNewPos.right - m_rcNewPos.left <= GetMinWidth() ) return;
rc.left = rc.right - GetMinWidth();
}
if( rc.right - rc.left >= GetMaxWidth() ) {
if( m_rcNewPos.right - m_rcNewPos.left >= GetMaxWidth() ) return;
rc.left = rc.right - GetMaxWidth();
}
}
CDuiRect rcInvalidate = GetThumbRect(true);
m_rcNewPos = rc;
m_cxyFixed.cx = m_rcNewPos.right - m_rcNewPos.left;
if( m_bImmMode ) {
m_rcItem = m_rcNewPos;
NeedParentUpdate();
}
else {
rcInvalidate.Join(GetThumbRect(true));
rcInvalidate.Join(GetThumbRect(false));
if( m_pManager ) m_pManager->Invalidate(rcInvalidate);
}
return;
}
}
if( event.Type == UIEVENT_SETCURSOR )
{
RECT rcSeparator = GetThumbRect(false);
if( IsEnabled() && ::PtInRect(&rcSeparator, event.ptMouse) ) {
::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE)));
return;
}
}
}
CContainerUI::DoEvent(event);
}
开发者ID:Shawber, 项目名称:xduilib, 代码行数:84, 代码来源:UIHorizontalLayout.cpp
示例3: rect1
void CalendarControl::Draw(BRect r)
{
#ifdef __UNIVERSAL_INTERFACE
if(interface==CC_ZETA_INTERFACE)
{
#endif
#ifdef __ZETA_INTERFACE
BRect rect1(Bounds());
rect1.bottom--;
rect1.right=pb->Frame().left-2;
BRect rect2(rect1);
BPoint p1, p2;
rgb_color color;
if(IsEnabled())
{
if(dtvc->IsFocus() && wc) // window is active and control is focused
// (control is enabled)
{
SetHighColor(170,50,184,0);
StrokeRect(rect1);
rect1.left++;
rect1.top++;
rect1.right--;
rect1.bottom--;
StrokeRect(rect1);
SetHighColor(255,255,255,0);
rect1.left++;
rect1.top++;
rect1.right--;
rect1.bottom--;
StrokeLine(rect1.LeftBottom(),rect1.RightBottom());
StrokeLine(rect1.RightTop(),rect1.RightBottom());
SetHighColor(218,218,218,0);
StrokeLine(rect1.LeftTop(),rect1.LeftBottom());
StrokeLine(rect1.LeftTop(),rect1.RightTop());
SetHighColor(114,114,114,0);
StrokeLine(rect1.LeftTop(),rect1.LeftTop());
StrokeLine(rect1.LeftBottom(),rect1.LeftBottom());
StrokeLine(rect1.RightTop(),rect1.RightTop());
StrokeLine(rect1.RightBottom(),rect1.RightBottom());
// outward borders
color.red=170+(uint8)((229-170)*(view_color.red-170)/(255-170));
color.green=50+(uint8)((194-50)*(view_color.green-50)/(255-50));
color.blue=184+(uint8)((233-184)*(view_color.blue-184)/(255-184));
color.alpha=255;
SetHighColor(color);
p1.Set(rect2.left,rect2.top+1);
p2.Set(rect2.left+1,rect2.top);
StrokeLine(p1,p2);
p1.Set(rect2.right,rect2.top+1);
p2.Set(rect2.right-1,rect2.top);
StrokeLine(p1,p2);
p1.Set(rect2.right,rect2.bottom-1);
p2.Set(rect2.right-1,rect2.bottom);
StrokeLine(p1,p2);
p1.Set(rect2.left,rect2.bottom-1);
p2.Set(rect2.left+1,rect2.bottom);
StrokeLine(p1,p2);
SetHighColor(view_color);
StrokeLine(rect2.LeftTop(),rect2.LeftTop());
StrokeLine(rect2.LeftBottom(),rect2.LeftBottom());
StrokeLine(rect2.RightTop(),rect2.RightTop());
StrokeLine(rect2.RightBottom(),rect2.RightBottom());
}
else // window is not active or control is unfocused (control is enabled)
{
SetHighColor(255,255,255,0);
rect1.left++;
rect1.top++;
rect1.right--;
rect1.bottom--;
StrokeRect(rect1);
rect1.left++;
rect1.top++;
rect1.right--;
rect1.bottom--;
StrokeRect(rect1);
rect1=rect2;
SetHighColor(0,0,0,0);
StrokeRect(rect1);
rect1.left++;
rect1.top++;
rect1.right--;
rect1.bottom--;
StrokeLine(rect1.LeftTop(),rect1.LeftTop());
StrokeLine(rect1.LeftBottom(),rect1.LeftBottom());
StrokeLine(rect1.RightTop(),rect1.RightTop());
StrokeLine(rect1.RightBottom(),rect1.RightBottom());
SetHighColor(180,180,180,0);
p1.Set(rect2.left+2,rect2.top+1);
p2.Set(rect2.right-2,rect2.top+1);
StrokeLine(p1,p2);
p1.Set(rect2.left+1,rect2.top+2);
p2.Set(rect2.left+1,rect2.bottom-2);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios, 项目名称:projectconcepto-svn, 代码行数:101, 代码来源:CalendarControl.cpp
示例4: GetControlFlags
UINT CSliderUI::GetControlFlags() const
{
if( IsEnabled() ) return UIFLAG_SETCURSOR;
else return 0;
}
开发者ID:pcjbird, 项目名称:MUIEditor, 代码行数:5, 代码来源:UISlider.cpp
示例5: GetControlFlags
UINT CTextUI::GetControlFlags() const
{
if( IsEnabled() && m_nLinks > 0 ) return UIFLAG_SETCURSOR;
else return 0;
}
开发者ID:0359xiaodong, 项目名称:TeamTalk, 代码行数:5, 代码来源:UIText.cpp
示例6: ccp_ReportStatus
int
ccp_ReportStatus(struct cmdargs const *arg)
{
struct ccp_opt **o;
struct link *l;
struct ccp *ccp;
int f;
l = command_ChooseLink(arg);
ccp = &l->ccp;
prompt_Printf(arg->prompt, "%s: %s [%s]\n", l->name, ccp->fsm.name,
State2Nam(ccp->fsm.state));
if (ccp->fsm.state == ST_OPENED) {
prompt_Printf(arg->prompt, " My protocol = %s, His protocol = %s\n",
protoname(ccp->my_proto), protoname(ccp->his_proto));
prompt_Printf(arg->prompt, " Output: %ld --> %ld, Input: %ld --> %ld\n",
ccp->uncompout, ccp->compout,
ccp->compin, ccp->uncompin);
}
if (ccp->in.algorithm != -1)
prompt_Printf(arg->prompt, "\n Input Options: %s\n",
(*algorithm[ccp->in.algorithm]->Disp)(&ccp->in.opt));
if (ccp->out.algorithm != -1) {
o = &ccp->out.opt;
for (f = 0; f < ccp->out.algorithm; f++)
if (IsEnabled(ccp->cfg.neg[algorithm[f]->Neg]))
o = &(*o)->next;
prompt_Printf(arg->prompt, " Output Options: %s\n",
(*algorithm[ccp->out.algorithm]->Disp)(&(*o)->val));
}
prompt_Printf(arg->prompt, "\n Defaults: ");
prompt_Printf(arg->prompt, "FSM retry = %us, max %u Config"
" REQ%s, %u Term REQ%s\n", ccp->cfg.fsm.timeout,
ccp->cfg.fsm.maxreq, ccp->cfg.fsm.maxreq == 1 ? "" : "s",
ccp->cfg.fsm.maxtrm, ccp->cfg.fsm.maxtrm == 1 ? "" : "s");
prompt_Printf(arg->prompt, " deflate windows: ");
prompt_Printf(arg->prompt, "incoming = %d, ", ccp->cfg.deflate.in.winsize);
prompt_Printf(arg->prompt, "outgoing = %d\n", ccp->cfg.deflate.out.winsize);
#ifndef NODES
prompt_Printf(arg->prompt, " MPPE: ");
if (ccp->cfg.mppe.keybits)
prompt_Printf(arg->prompt, "%d bits, ", ccp->cfg.mppe.keybits);
else
prompt_Printf(arg->prompt, "any bits, ");
switch (ccp->cfg.mppe.state) {
case MPPE_STATEFUL:
prompt_Printf(arg->prompt, "stateful");
break;
case MPPE_STATELESS:
prompt_Printf(arg->prompt, "stateless");
break;
case MPPE_ANYSTATE:
prompt_Printf(arg->prompt, "any state");
break;
}
prompt_Printf(arg->prompt, "%s\n",
ccp->cfg.mppe.required ? ", required" : "");
#endif
prompt_Printf(arg->prompt, "\n DEFLATE: %s\n",
command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE]));
prompt_Printf(arg->prompt, " PREDICTOR1: %s\n",
command_ShowNegval(ccp->cfg.neg[CCP_NEG_PRED1]));
prompt_Printf(arg->prompt, " DEFLATE24: %s\n",
command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE24]));
#ifndef NODES
prompt_Printf(arg->prompt, " MPPE: %s\n",
command_ShowNegval(ccp->cfg.neg[CCP_NEG_MPPE]));
#endif
return 0;
}
开发者ID:Abocer, 项目名称:android-4.2_r1, 代码行数:75, 代码来源:ccp.c
示例7: PDMFactory
/* static */
bool
MP4Decoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
const nsAString& aCodecs)
{
if (!IsEnabled()) {
return false;
}
// Whitelist MP4 types, so they explicitly match what we encounter on
// the web, as opposed to what we use internally (i.e. what our demuxers
// etc output).
const bool isMP4Audio = aMIMETypeExcludingCodecs.EqualsASCII("audio/mp4") ||
aMIMETypeExcludingCodecs.EqualsASCII("audio/x-m4a");
const bool isMP4Video =
// On B2G, treat 3GPP as MP4 when Gonk PDM is available.
#ifdef MOZ_GONK_MEDIACODEC
aMIMETypeExcludingCodecs.EqualsASCII(VIDEO_3GPP) ||
#endif
aMIMETypeExcludingCodecs.EqualsASCII("video/mp4") ||
aMIMETypeExcludingCodecs.EqualsASCII("video/x-m4v");
if (!isMP4Audio && !isMP4Video) {
return false;
}
nsTArray<nsCString> codecMimes;
if (aCodecs.IsEmpty()) {
// No codecs specified. Assume AAC/H.264
if (isMP4Audio) {
codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/mp4a-latm"));
} else {
MOZ_ASSERT(isMP4Video);
codecMimes.AppendElement(NS_LITERAL_CSTRING("video/avc"));
}
} else {
// Verify that all the codecs specified are ones that we expect that
// we can play.
nsTArray<nsString> codecs;
if (!ParseCodecsString(aCodecs, codecs)) {
return false;
}
for (const nsString& codec : codecs) {
if (IsAACCodecString(codec)) {
codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/mp4a-latm"));
continue;
}
if (codec.EqualsLiteral("mp3")) {
codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/mpeg"));
continue;
}
// Note: Only accept H.264 in a video content type, not in an audio
// content type.
if (IsWhitelistedH264Codec(codec) && isMP4Video) {
codecMimes.AppendElement(NS_LITERAL_CSTRING("video/avc"));
continue;
}
// Some unsupported codec.
return false;
}
}
// Verify that we have a PDM that supports the whitelisted types.
PDMFactory::Init();
RefPtr<PDMFactory> platform = new PDMFactory();
for (const nsCString& codecMime : codecMimes) {
if (!platform->SupportsMimeType(codecMime)) {
return false;
}
}
return true;
}
开发者ID:ajkerrigan, 项目名称:gecko-dev, 代码行数:72, 代码来源:MP4Decoder.cpp
示例8: MAKEINTRESOURCE
void CDateTimeUI::DoEvent(TEventUI& event)
{
if (!IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND) {
if (m_pParent != NULL) m_pParent->DoEvent(event);
else CLabelUI::DoEvent(event);
return;
}
if (event.Type == UIEVENT_SETCURSOR && IsEnabled()) {
::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM)));
return;
}
if (event.Type == UIEVENT_WINDOWSIZE) {
if (m_pWindow != NULL) m_pManager->SetFocusNeeded(this);
}
if (event.Type == UIEVENT_SCROLLWHEEL) {
if (m_pWindow != NULL) return;
}
if (event.Type == UIEVENT_SETFOCUS && IsEnabled()) {
if (m_pWindow) return;
m_pWindow = new CDateTimeWnd();
ASSERT(m_pWindow);
m_pWindow->Init(this);
m_pWindow->ShowWindow();
}
if (event.Type == UIEVENT_KILLFOCUS && IsEnabled()) {
Invalidate();
}
if (event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK || event.Type == UIEVENT_RBUTTONDOWN) {
if (IsEnabled()) {
GetManager()->ReleaseCapture();
if (IsFocused() && m_pWindow == NULL) {
m_pWindow = new CDateTimeWnd();
ASSERT(m_pWindow);
}
if (m_pWindow != NULL) {
m_pWindow->Init(this);
m_pWindow->ShowWindow();
}
}
return;
}
if (event.Type == UIEVENT_MOUSEMOVE) {
return;
}
if (event.Type == UIEVENT_BUTTONUP) {
return;
}
if (event.Type == UIEVENT_CONTEXTMENU) {
return;
}
if (event.Type == UIEVENT_MOUSEENTER) {
return;
}
if (event.Type == UIEVENT_MOUSELEAVE) {
return;
}
CLabelUI::DoEvent(event);
}
开发者ID:wyrover, 项目名称:DuiLib-wyrover, 代码行数:75, 代码来源:UIDateTime.cpp
示例9: GetSize
void Slider::Layout()
{
const auto &size = GetSize();
double w = size.x;
const auto &s = display.styles;
background->SetSize(size);
double scale = w / (max - min);
double offset, len;
if (min > 0) {
len = (value - min) * scale;
offset = 0;
}
else if (max < 0) {
len = -(value - max) * scale;
offset = w - len;
}
else {
double zeroPoint = -min * scale;
zeroLine->SetLength(size.y);
zeroLine->SetPos(zeroPoint, 0);
if (value < 0) {
len = -value * scale;
offset = zeroPoint - len;
}
else if (value > 0) {
len = value * scale;
offset = zeroPoint;
}
else {
len = 0;
offset = zeroPoint;
}
}
indicator->SetPos(offset, 0);
indicator->SetSize(len, size.y);
if (!IsEnabled()) {
background->SetColor(s.buttonDisabledBg);
indicator->SetColor(s.buttonDisabledBg);
}
else if (IsPressed()) {
background->SetColor(s.buttonPressedBg);
indicator->SetColor(s.buttonPressedBg);
}
else {
background->SetColor(s.buttonBg);
indicator->SetColor(s.buttonBg);
}
if (IsFocused()) {
background->SetBorder(4);
background->SetBorderColor(s.buttonFocusedBg);
}
else {
background->SetBorder(0);
}
}
开发者ID:HoverRace, 项目名称:HoverRace, 代码行数:61, 代码来源:Slider.cpp
示例10: GetThumbRect
void CUIVerticalLayout::DoEvent(TEventUI& event)
{
if( m_iSepHeight != 0 ) {
if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() ){
CUIRect rcSeparator = GetThumbRect(false);
if(rcSeparator.IsPtIn(event.ptMouse)) {
m_uButtonState |= UISTATE_CAPTURED;
ptLastMouse = event.ptMouse;
m_rcNewPos = m_rcItem;
if(!m_bImmMode /*&& m_pManager*/)
/*m_pManager->AddPostPaint(this);*/
return;
}
}
if( event.Type == UIEVENT_BUTTONUP ){
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
m_uButtonState &= ~UISTATE_CAPTURED;
m_rcItem = m_rcNewPos;
if( !m_bImmMode /*&& m_pManager*/ )
/*m_pManager->RemovePostPaint(this);*/
NeedParentUpdate();
return;
}
}
if( event.Type == UIEVENT_MOUSEMOVE ){
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
LONG cy = event.ptMouse.y - ptLastMouse.y;
ptLastMouse = event.ptMouse;
RECT rc = m_rcNewPos;
if( m_iSepHeight >= 0 ) {
if( cy > 0 && event.ptMouse.y < m_rcNewPos.bottom + m_iSepHeight )
return;
if( cy < 0 && event.ptMouse.y > m_rcNewPos.bottom )
return;
rc.bottom += cy;
if( rc.bottom - rc.top <= GetMinHeight() ) {
if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() )
return;
rc.bottom = rc.top + GetMinHeight();
}
if( rc.bottom - rc.top >= GetMaxHeight() ) {
if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() )
return;
rc.bottom = rc.top + GetMaxHeight();
}
}else{
if( cy > 0 && event.ptMouse.y < m_rcNewPos.top )
return;
if( cy < 0 && event.ptMouse.y > m_rcNewPos.top + m_iSepHeight )
return;
rc.top += cy;
if( rc.bottom - rc.top <= GetMinHeight() ) {
if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() )
return;
rc.top = rc.bottom - GetMinHeight();
}
if( rc.bottom - rc.top >= GetMaxHeight() ) {
if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() )
return;
rc.top = rc.bottom - GetMaxHeight();
}
}
CUIRect rcInvalidate = GetThumbRect(true);
m_rcNewPos = rc;
m_cxyFixed.cy = m_rcNewPos.bottom - m_rcNewPos.top;
if( m_bImmMode ) {
m_rcItem = m_rcNewPos;
NeedParentUpdate();
}else{
rcInvalidate.Join(GetThumbRect(true));
rcInvalidate.Join(GetThumbRect(false));
if(m_Window)
m_Window->Invalidate(rcInvalidate);
}
return;
}
}
if( event.Type == UIEVENT_SETCURSOR )
{
CUIRect rcSeparator = GetThumbRect(false);
if( IsEnabled() && rcSeparator.IsPtIn(event.ptMouse)) {
//
// TODO: SetCursor
//
//::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS)));
return;
}
}
}
CUIContainer::DoEvent(event);
}
开发者ID:asdlei00, 项目名称:gtkduilib, 代码行数:95, 代码来源:UIVerticalLayout.cpp
示例11: dc
void SToolBarButton::onPaint(wxPaintEvent& e)
{
wxPaintDC dc(this);
// Get system colours needed
wxColour col_background = Drawing::getMenuBarBGColour();
wxColour col_hilight = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
// Draw background
dc.SetBackground(wxBrush(col_background));
dc.Clear();
// Create graphics context
wxGraphicsContext* gc = wxGraphicsContext::Create(dc);
if (!gc)
return;
// Draw toggled border/background
if (action->isToggled())
{
// Use greyscale version of hilight colour
uint8_t r = col_hilight.Red();
uint8_t g = col_hilight.Green();
uint8_t b = col_hilight.Blue();
wxColour::MakeGrey(&r, &g, &b);
wxColour col_toggle(r, g, b, 255);
wxColour col_trans(r, g, b, 150);
if (toolbar_button_flat)
{
// Draw border
col_trans.Set(col_trans.Red(), col_trans.Green(), col_trans.Blue(), 80);
gc->SetBrush(col_trans);
gc->SetPen(wxPen(Drawing::darkColour(col_toggle, 5.0f)));
gc->DrawRectangle(1, 1, 20, 20);
}
else
{
// Draw border
gc->SetBrush(col_trans);
gc->SetPen(wxPen(Drawing::lightColour(col_toggle, 5.0f), 1));
gc->DrawRoundedRectangle(2, 2, 18, 18, 2);
// Draw outer border
gc->SetBrush(wxBrush(col_toggle, wxBRUSHSTYLE_TRANSPARENT));
gc->SetPen(wxPen(Drawing::darkColour(col_toggle, 5.0f)));
gc->DrawRoundedRectangle(1, 1, 20, 20, 2);
}
}
// Draw border on mouseover
if (state == STATE_MOUSEOVER || state == STATE_MOUSEDOWN)
{
// Determine transparency level
int trans = 160;
if (state == STATE_MOUSEDOWN)
trans = 200;
// Create semitransparent hilight colour
wxColour col_trans(col_hilight.Red(), col_hilight.Green(), col_hilight.Blue(), trans);
if (toolbar_button_flat)
{
// Draw border
col_trans.Set(col_trans.Red(), col_trans.Green(), col_trans.Blue(), 80);
gc->SetBrush(col_trans);
gc->SetPen(wxPen(col_hilight));
gc->DrawRectangle(1, 1, 20, 20);
}
else
{
// Draw border
gc->SetBrush(col_trans);
gc->SetPen(wxPen(Drawing::lightColour(col_hilight, 5.0f), 1));
gc->DrawRoundedRectangle(2, 2, 18, 18, 2);
// Draw outer border
gc->SetBrush(wxBrush(col_hilight, wxBRUSHSTYLE_TRANSPARENT));
gc->SetPen(wxPen(Drawing::darkColour(col_hilight, 5.0f)));
gc->DrawRoundedRectangle(1, 1, 20, 20, 2);
}
}
// Draw disabled icon if disabled
if (!IsEnabled())
{
// Determine toolbar background brightness
uint8_t r,g,b;
r = col_background.Red();
g = col_background.Green();
b = col_background.Blue();
wxColor::MakeGrey(&r, &g, &b);
// Draw disabled icon
gc->DrawBitmap(icon.ConvertToDisabled(r), 3, 3, 16, 16);
}
// Otherwise draw normal icon
else
gc->DrawBitmap(icon, 3, 3, 16, 16);
//.........这里部分代码省略.........
开发者ID:IjonTichy, 项目名称:SLADE, 代码行数:101, 代码来源:SToolBarButton.cpp
示例12: Activate
bool CControlUI::Activate()
{
if( !IsVisible() ) return false;
if( !IsEnabled() ) return false;
return true;
}
开发者ID:Crawping, 项目名称:IocpServerClient_Side, 代码行数:6, 代码来源:UIControl.cpp
示例13: PaintText
void CLabelUI::PaintText(HDC hDC)
{
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
RECT rc = m_rcItem;
rc.left += m_rcTextPadding.left;
rc.right -= m_rcTextPadding.right;
rc.top += m_rcTextPadding.top;
rc.bottom -= m_rcTextPadding.bottom;
if(!GetEnabledEffect())
{
if( m_sText.IsEmpty() ) return;
int nLinks = 0;
if( IsEnabled() ) {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \
NULL, NULL, nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \
m_iFont, m_uTextStyle);
}
else {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \
NULL, NULL, nLinks, DT_SINGLELINE | m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \
m_iFont, DT_SINGLELINE | m_uTextStyle);
}
}
else
{
Font nFont(hDC,m_pManager->GetFont(GetFont()));
Graphics nGraphics(hDC);
nGraphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
StringFormat format;
StringAlignment sa = StringAlignment::StringAlignmentNear;
if ((m_uTextStyle & DT_VCENTER) != 0) sa = StringAlignment::StringAlignmentCenter;
else if( (m_uTextStyle & DT_BOTTOM) != 0) sa = StringAlignment::StringAlignmentFar;
format.SetAlignment((StringAlignment)sa);
sa = StringAlignment::StringAlignmentNear;
if ((m_uTextStyle & DT_CENTER) != 0) sa = StringAlignment::StringAlignmentCenter;
else if( (m_uTextStyle & DT_RIGHT) != 0) sa = StringAlignment::StringAlignmentFar;
format.SetLineAlignment((StringAlignment)sa);
RectF nRc((float)rc.left,(float)rc.top,(float)rc.right-rc.left,(float)rc.bottom-rc.top);
RectF nShadowRc = nRc;
nShadowRc.X += m_ShadowOffset.X;
nShadowRc.Y += m_ShadowOffset.Y;
int nGradientLength = GetGradientLength();
if(nGradientLength == 0)
nGradientLength = (rc.bottom-rc.top);
LinearGradientBrush nLineGrBrushA(Point(GetGradientAngle(), 0),Point(0,nGradientLength),ARGB2Color(GetTextShadowColorA()),ARGB2Color(GetTextShadowColorB() == -1?GetTextShadowColorA():GetTextShadowColorB()));
LinearGradientBrush nLineGrBrushB(Point(GetGradientAngle(), 0),Point(0,nGradientLength),ARGB2Color(GetTextColor()),ARGB2Color(GetTextColor1() == -1?GetTextColor():GetTextColor1()));
if (GetEnabledLuminous())
{
// from http://bbs.csdn.net/topics/390346428
int iFuzzyWidth = (int)(nRc.Width/GetLuminousFuzzy());
if (iFuzzyWidth < 1) iFuzzyWidth = 1;
int iFuzzyHeight = (int)(nRc.Height/GetLuminousFuzzy());
if (iFuzzyHeight < 1) iFuzzyHeight = 1;
RectF nTextRc(0.0f, 0.0f, nRc.Width, nRc.Height);
Bitmap Bit1((INT)nRc.Width, (INT)nRc.Height);
Graphics g1(&Bit1);
g1.SetSmoothingMode(SmoothingModeAntiAlias);
g1.SetTextRenderingHint(TextRenderingHintAntiAlias);
g1.SetCompositingQuality(CompositingQualityAssumeLinear);
Bitmap Bit2(iFuzzyWidth, iFuzzyHeight);
Graphics g2(&Bit2);
g2.SetInterpolationMode(InterpolationModeHighQualityBicubic);
g2.SetPixelOffsetMode(PixelOffsetModeNone);
FontFamily ftFamily;
nFont.GetFamily(&ftFamily);
int iLen = wcslen(m_pWideText);
g1.DrawString(m_pWideText,iLen,&nFont,nRc,&format,&nLineGrBrushB);
g2.DrawImage(&Bit1, 0, 0, (int)iFuzzyWidth, (int)iFuzzyHeight);
g1.Clear(Color(0));
g1.DrawImage(&Bit2, (int)m_ShadowOffset.X, (int)m_ShadowOffset.Y, (int)nRc.Width, (int)nRc.Height);
g1.SetTextRenderingHint(TextRenderingHintAntiAlias);
nGraphics.DrawImage(&Bit1, nRc.X, nRc.Y);
}
if(GetEnabledStroke() && GetStrokeColor() > 0)
{
LinearGradientBrush nLineGrBrushStroke(Point(GetGradientAngle(),0),Point(0,rc.bottom-rc.top+2),ARGB2Color(GetStrokeColor()),ARGB2Color(GetStrokeColor()));
#ifdef _UNICODE
nRc.Offset(-1,0);
nGraphics.DrawString(m_sText,m_sText.GetLength(),&nFont,nRc,&format,&nLineGrBrushStroke);
nRc.Offset(2,0);
//.........这里部分代码省略.........
开发者ID:CharZhou, 项目名称:duilib, 代码行数:101, 代码来源:UILabel.cpp
示例14: IsEnabled
bool CZClip::Enable(bool bOnOff)
{
m_bEnabled = !m_bEnabled;
return IsEnabled();
}
开发者ID:DanielGibson, 项目名称:dhewm3, 代码行数:5, 代码来源:ZClip.cpp
示例15: SetEnabled
void CLEDEntity::SetEnabled(bool b_enabled) {
CEntity::SetEnabled(b_enabled);
if(IsEnabled()) {
m_cColor = m_cInitColor;
}
}
开发者ID:hoelzl, 项目名称:argos3, 代码行数:6, 代码来源:led_entity.cpp
示例16: _updateChildren
void TAbstractWindow::_updateChildren() {
if (IsEnabled() == false) {
return;
}
parent_type::_updateChildren();
}
开发者ID:zhiltsov-max, 项目名称:tower-defense, 代码行数:6, 代码来源:abstractwindow.cpp
示例17: PaintStatusImage
void CFadeButtonUI::PaintStatusImage(HDC hDC)
{
if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
else m_uButtonState &= ~ UISTATE_FOCUSED;
if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
else m_uButtonState &= ~ UISTATE_DISABLED;
if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
if( !m_sDisabledImage.IsEmpty() ) {
if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) {}
else return;
}
}
else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
if( !m_sPushedImage.IsEmpty() ) {
if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ) {}
else return;
}
}
else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
if( !m_sFocusedImage.IsEmpty() ) {
if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) {}
else return;
}
}
if( !m_sNormalImage.IsEmpty() ) {
if( IsAnimationRunning(FADE_IN_ID) || IsAnimationRunning(FADE_OUT_ID)) {
if( m_bMouseHove ) {
m_bMouseHove = FALSE;
m_sLastImage = m_sHotImage;
if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) {}
return;
}
if( m_bMouseLeave ) {
m_bMouseLeave = FALSE;
m_sLastImage = m_sNormalImage;
if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) {}
return;
}
m_sOldImage = m_sNormalImage;
m_sNewImage = m_sHotImage;
if( IsAnimationRunning(FADE_OUT_ID) ) {
m_sOldImage = m_sHotImage;
m_sNewImage = m_sNormalImage;
}
CDuiString sFadeOut, sFadeIn;
sFadeOut.Format(_T("fade='%d'"), 255 - m_bFadeAlpha);
sFadeIn.Format(_T("fade='%d'"), m_bFadeAlpha);
if( !DrawImage(hDC, (LPCTSTR)m_sOldImage, sFadeOut) ) {}
if( !DrawImage(hDC, (LPCTSTR)m_sNewImage, sFadeIn) ) {}
return;
}
else {
if(m_sLastImage.IsEmpty()) m_sLastImage = m_sNormalImage;
if( !DrawImage(hDC, (LPCTSTR)m_sLastImage) ) {}
return;
}
}
}
开发者ID:yimsungnam, 项目名称:DuiLib_Ultimate, 代码行数:62, 代码来源:UIFadeButton.cpp
示例18: GetBestSize
bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
{
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)item;
if ( !IsOwnerDrawn() || dis->CtlType != ODT_BUTTON )
return wxCheckBoxBase::MSWOnDraw(item);
// calculate the rectangles for the check mark itself and the label
HDC hdc = dis->hDC;
RECT& rect = dis->rcItem;
RECT rectCheck,
rectLabel;
rectCheck.top =
rectLabel.top = rect.top;
rectCheck.bottom =
rectLabel.bottom = rect.bottom;
const int checkSize = GetBestSize().y;
const int MARGIN = 3;
const bool isRightAligned = HasFlag(wxALIGN_RIGHT);
if ( isRightAligned )
{
rectCheck.right = rect.right;
rectCheck.left = rectCheck.right - checkSize;
rectLabel.right = rectCheck.left - MARGIN;
rectLabel.left = rect.left;
}
else // normal, left-aligned checkbox
{
rectCheck.left = rect.left;
rectCheck.right = rectCheck.left + checkSize;
rectLabel.left = rectCheck.right + MARGIN;
rectLabel.right = rect.right;
}
// show we draw a focus rect?
const bool isFocused = m_isPressed || FindFocus() == this;
// draw the checkbox itself
wxDCTemp dc(hdc);
int flags = 0;
if ( !IsEnabled() )
flags |= wxCONTROL_DISABLED;
switch ( Get3StateValue() )
{
case wxCHK_CHECKED:
flags |= wxCONTROL_CHECKED;
break;
case wxCHK_UNDETERMINED:
flags |= wxCONTROL_PRESSED;
break;
default:
wxFAIL_MSG( wxT("unexpected Get3StateValue() return value") );
// fall through
case wxCHK_UNCHECKED:
// no extra styles needed
break;
}
if ( wxFindWindowAtPoint(wxGetMousePosition()) == this )
flags |= wxCONTROL_CURRENT;
wxRendererNative::Get().
DrawCheckBox(this, dc, wxRectFromRECT(rectCheck), flags);
// draw the text
const wxString& label = GetLabel();
// first we need to measure it
UINT fmt = DT_NOCLIP;
// drawing underlying doesn't look well with focus rect (and the native
// control doesn't do it)
if ( isFocused )
fmt |= DT_HIDEPREFIX;
if ( isRightAligned )
fmt |= DT_RIGHT;
// TODO: also use DT_HIDEPREFIX if the system is configured so
// we need to get the label real size first if we have to draw a focus rect
// around it
if ( isFocused )
{
if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel,
fmt | DT_CALCRECT) )
{
wxLogLastError(wxT("DrawText(DT_CALCRECT)"));
}
}
if ( !IsEnabled() )
{
::SetTextColor(hdc, ::GetSysColor(COLOR_GRAYTEXT));
//.........这里部分代码省略.........
开发者ID:mark711, 项目名称:Cafu, 代码行数:101, 代码来源:checkbox.cpp
示例19: CcpLayerUp
/* Called when CCP has reached the OPEN state */
static int
CcpLayerUp(struct fsm *fp)
{
/* We're now up */
struct ccp *ccp = fsm2ccp(fp);
struct ccp_opt **o;
unsigned f, fail;
for (f = fail = 0; f < NALGORITHMS; f++)
if (IsEnabled(ccp->cfg.neg[algorithm[f]->Neg]) &&
(*algorithm[f]->Required)(&ccp->fsm) &&
(ccp->in.algorithm != (int)f || ccp->out.algorithm != (int)f)) {
/* Blow it all away - we haven't negotiated a required algorithm */
log_Printf(LogWARN, "%s: Failed to negotiate (required) %s\n",
fp->link->name, protoname(algorithm[f]->id));
fail = 1;
}
if (fail) {
ccp->his_proto = ccp->my_proto = -1;
fsm_Close(fp);
fsm_Close(&fp->link->lcp.fsm);
return 0;
}
log_Printf(LogCCP, "%s: LayerUp.\n", fp->link->name);
if (ccp->in.state == NULL && ccp->in.algorithm >= 0 &&
ccp->in.algorithm < (int)NALGORITHMS) {
ccp->in.state = (*algorithm[ccp->in.algorithm]->i.Init)
(fp->bundle, &ccp->in.opt);
if (ccp->in.state == NULL) {
log_Printf(LogERROR, "%s: %s (in) initialisation failure\n",
fp->link->name, protoname(ccp->his_proto));
ccp->his_proto = ccp->my_proto = -1;
fsm_Close(fp);
return 0;
}
}
o = &ccp->out.opt;
if (ccp->out.algorithm > 0)
for (f = 0; f < (unsigned)ccp->out.algorithm; f++)
if (IsEnabled(ccp->cfg.neg[algorithm[f]->Neg]))
o = &(*o)->next;
if (ccp->out.state == NULL && ccp->out.algorithm >= 0 &&
ccp->out.algorithm < (int)NALGORITHMS) {
ccp->out.state = (*algorithm[ccp->out.algorithm]->o.Init)
(fp->bundle, &(*o)->val);
if (ccp->out.state == NULL) {
log_Printf(LogERROR, "%s: %s (out) initialisation failure\n",
fp->link->name, protoname(ccp->my_proto));
ccp->his_proto = ccp->my_proto = -1;
fsm_Close(fp);
return 0;
}
}
fp->more.reqs = fp->more.naks = fp->more.rejs = ccp->cfg.fsm.maxreq * 3;
log_Printf(LogCCP, "%s: Out = %s[%d], In = %s[%d]\n",
fp->link->name, protoname(ccp->my_proto), ccp->my_proto,
protoname(ccp->his_proto), ccp->his_proto);
return 1;
}
开发者ID:Abocer, 项目名称:android-4.2_r1, 代码行数:68, 代码来源:ccp.c
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:18247| 2023-10-27
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9669| 2022-11-06
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8175| 2022-11-06
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8547| 2022-11-06
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8454| 2022-11-06
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9383| 2022-11-06
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8426| 2022-11-06
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7859| 2022-11-06
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8410| 2022-11-06
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7394| 2022-11-06
请发表评论