commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
58
include/engine/ui/widget_check.cpp
Normal file
58
include/engine/ui/widget_check.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "ui/widget_check.h"
|
||||
|
||||
using namespace GS;
|
||||
using namespace GS::S2D;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void CheckWidget::SetState(bool b_state)
|
||||
{
|
||||
state = b_state;
|
||||
// check_bitmap.SetPicture(state ? "scene2d/ui_check_true.tga" : "scene2d/ui_check_false.tga");
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void CheckWidget::Refresh()
|
||||
{
|
||||
check_bitmap.Refresh();
|
||||
label.Refresh();
|
||||
dirty = check_bitmap.IsDirty() || label.IsDirty();
|
||||
}
|
||||
void CheckWidget::Invalidate()
|
||||
{
|
||||
check_bitmap.Invalidate();
|
||||
label.Invalidate();
|
||||
Widget::Invalidate();
|
||||
}
|
||||
void CheckWidget::Compose(Picture &output, const iRect &out_rect)
|
||||
{
|
||||
if (hidden || !dirty)
|
||||
return;
|
||||
|
||||
rect = out_rect;
|
||||
rect.sy += (int)border_size.x;
|
||||
rect.ey -= (int)border_size.y;
|
||||
rect.sx += (int)border_size.z;
|
||||
rect.ex -= (int)border_size.w;
|
||||
|
||||
// Compose check box and label.
|
||||
Rect <int> check_rect(rect), label_rect(rect);
|
||||
|
||||
if (check_bitmap.GetPicture())
|
||||
{
|
||||
check_rect.ex = check_rect.sx + (check_bitmap.GetPicture()->GetWidth() * 3) / 2;
|
||||
label_rect.sx = check_rect.ex;
|
||||
}
|
||||
check_bitmap.Compose(output, check_rect);
|
||||
label.Compose(output, label_rect);
|
||||
|
||||
dirty = false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user