|
|
|
@ -17,6 +17,17 @@ void Window::InternalUpdate(FiestaOnlineEditor*pge,float fElapsedTime){ |
|
|
|
|
if(dragging){ |
|
|
|
|
pos=pge->GetMousePos()-dragPoint; |
|
|
|
|
} |
|
|
|
|
if(pge->GetMouseX()>=pos.x+size.x-64&&pge->GetMouseY()<pos.y+headerHeight&&pge->GetMouseY()>=pos.y){ |
|
|
|
|
if(!canClose){ |
|
|
|
|
canClose=true; |
|
|
|
|
InternalRefresh(pge); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if(canClose){ |
|
|
|
|
canClose=false; |
|
|
|
|
InternalRefresh(pge); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::InternalRefresh(FiestaOnlineEditor*pge){ |
|
|
|
@ -25,9 +36,17 @@ void Window::InternalRefresh(FiestaOnlineEditor*pge){ |
|
|
|
|
|
|
|
|
|
//Window background drawing
|
|
|
|
|
if(focusedWindow==this){ |
|
|
|
|
pge->FillRect({0,headerHeight},size,VERY_DARK_BLUE); |
|
|
|
|
if(canClose){ |
|
|
|
|
pge->FillRect({0,headerHeight},size,VERY_DARK_RED); |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,headerHeight},size,VERY_DARK_BLUE); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,headerHeight},size,VERY_DARK_GREY); |
|
|
|
|
if(canClose){ |
|
|
|
|
pge->FillRect({0,headerHeight},size,DARK_GREY); |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,headerHeight},size,VERY_DARK_GREY); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//All other drawing functions should go here.
|
|
|
|
@ -36,9 +55,17 @@ void Window::InternalRefresh(FiestaOnlineEditor*pge){ |
|
|
|
|
Refresh(pge); |
|
|
|
|
pos.y-=headerHeight; |
|
|
|
|
if(focusedWindow==this){ |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},VERY_DARK_BLUE); |
|
|
|
|
if(canClose){ |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},VERY_DARK_RED); |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},VERY_DARK_BLUE); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},VERY_DARK_GREY); |
|
|
|
|
if(canClose){ |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},DARK_GREY); |
|
|
|
|
} else { |
|
|
|
|
pge->FillRect({0,0},{size.x,headerHeight},VERY_DARK_GREY); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pge->DrawString({2,2},windowTitle,CYAN); |
|
|
|
|
pge->DrawLine({1,10},{size.x-2,10},DARK_CYAN,0xFFFFFF00); |
|
|
|
@ -79,5 +106,16 @@ void Window::InternalMouseFocus(FiestaOnlineEditor*pge){ |
|
|
|
|
if(pge->GetMouse(0).bReleased){ |
|
|
|
|
dragging=false; |
|
|
|
|
} |
|
|
|
|
if(pge->GetMouse(1).bPressed){ |
|
|
|
|
closed=true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
void Window::MouseFocus(FiestaOnlineEditor*pge){} |
|
|
|
|
void Window::MouseFocus(FiestaOnlineEditor*pge){} |
|
|
|
|
|
|
|
|
|
bool Window::IsClosed(){ |
|
|
|
|
return closed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::SetFocusedWindow(Window*w){ |
|
|
|
|
focusedWindow=w;
|
|
|
|
|
} |