mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-19 17:35:38 -04:00

- UTF8-ify where possible - Remove custom linkerscript - Update Makefiles - devkitPro/nds-examples@6afa09b205 - Comment out akloader binaries - This will be reworked soon™️ - Eradicate sdidentify - AKRPG specific - Eradicate libelm - Eradicate save64m - Eradicate file operations - Eradicate libio* - Eradicate crtsmall - Fix paths for new root drive naming in latest libfat - dsrom: fix type cast issue in homebrew check - MAX_FILENAME_LENGTH -> PATH_MAX - adapt directory listing operations to new dkP way - timer: unstaticify _factor - Remove all flashcart-specific bits - fix type of cPopMenu::itemBelowPoint - gbaloader: use updated vramSetPrimaryBanks function - Move arm9-specific headers to arm9
103 lines
3.2 KiB
C++
103 lines
3.2 KiB
C++
/*
|
||
formdesc.cpp
|
||
Copyright (C) 2007 Acekard, www.acekard.com
|
||
Copyright (C) 2007-2009 somebody
|
||
Copyright (C) 2009 yellow wood goblin
|
||
|
||
This program is free software: you can redistribute it and/or modify
|
||
it under the terms of the GNU General Public License as published by
|
||
the Free Software Foundation, either version 3 of the License, or
|
||
(at your option) any later version.
|
||
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
*/
|
||
|
||
#include "ui.h"
|
||
#include "formdesc.h"
|
||
|
||
//#include "globalsettings.h"
|
||
|
||
|
||
namespace akui
|
||
{
|
||
|
||
// 边框颜色:b5c71f
|
||
// 23, 25, 4
|
||
// 框内背景色:eeebae
|
||
// 30, 29, 22
|
||
|
||
cFormDesc::cFormDesc()
|
||
{
|
||
_bodyColor = uiSettings().formBodyColor; //RGB15(30,29,22);
|
||
_frameColor = uiSettings().formFrameColor;//RGB15(23,25,4);
|
||
}
|
||
|
||
cFormDesc::~cFormDesc()
|
||
{
|
||
|
||
}
|
||
|
||
void cFormDesc::draw( const cRect & area, GRAPHICS_ENGINE engine ) const
|
||
{
|
||
if( _topleft.valid() ) {
|
||
gdi().maskBlt(
|
||
_topleft.buffer(), area.position().x, area.position().y, _topleft.width(), _topleft.height(), engine );
|
||
}
|
||
|
||
if( _middle.valid() ) {
|
||
for( u32 i = 0; i < _middle.height(); ++i )
|
||
{
|
||
COLOR lineColor = _middle.buffer()[i] & 0xFFFF;
|
||
gdi().setPenColor( lineColor, engine );
|
||
gdi().fillRect( lineColor, lineColor, area.position().x + _topleft.width(),
|
||
area.position().y + i,
|
||
area.size().x - _topleft.width() - _topright.width(),
|
||
1, engine );
|
||
}
|
||
}
|
||
|
||
if( _topright.valid() ) {
|
||
gdi().maskBlt( _topright.buffer(),
|
||
area.position().x + area.size().x - _topright.width(), area.position().y,
|
||
_topright.width(), _topright.height(), engine );
|
||
}
|
||
|
||
if( _titleText != "" ) {
|
||
gdi().setPenColor( uiSettings().formTitleTextColor, engine );
|
||
gdi().textOut( area.position().x + 8,
|
||
area.position().y + (((_topleft.height() - gs().fontHeight)) >> 1) + 1,
|
||
_titleText.c_str(), engine );
|
||
}
|
||
|
||
gdi().setPenColor( _bodyColor, engine );
|
||
gdi().fillRect( _bodyColor, _bodyColor, area.topLeft().x, area.topLeft().y + _topleft.height(),
|
||
area.width(), area.height() - _topleft.height(), engine );
|
||
|
||
gdi().setPenColor( _frameColor, engine );
|
||
gdi().frameRect( area.topLeft().x, area.topLeft().y + _topleft.height(),
|
||
area.width(), area.height() - _topleft.height(), uiSettings().thickness, engine );
|
||
|
||
}
|
||
|
||
void cFormDesc::loadData( const std::string & topleftBmpFile,
|
||
const std::string & toprightBmpFile,
|
||
const std::string & middleBmpFile )
|
||
{
|
||
_topleft = createBMP15FromFile( topleftBmpFile );
|
||
_topright = createBMP15FromFile( toprightBmpFile );
|
||
_middle = createBMP15FromFile( middleBmpFile );
|
||
}
|
||
|
||
void cFormDesc::setTitleText( const std::string & text )
|
||
{
|
||
_titleText = text;
|
||
}
|
||
|
||
}
|