Skip to content

Commit

Permalink
change: 宏定义名
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLHy0424 committed Sep 2, 2024
1 parent 0eef8ff commit dbefd6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ auto main(i32 argc,cstr argv[])->i32{
if(optErr){
ui.push(" (!) 参数错误.\n");
}
ui.push(" > 退出 ",Mod::exit,WC_RED_PALE);
ui.push(" > 退出 ",Mod::exit,CON_RED_PALE);
if(opt.largeView){
ui.push("\0");
}
Expand Down
14 changes: 7 additions & 7 deletions src/ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
#define MOUSE_CLICK_DOUBLE DOUBLE_CLICK
#define MOUSE_MOVE MOUSE_MOVED
#define MOUSE_WHEEL MOUSE_WHEELED
#define WC_WHITE 0x07
#define WC_BLUE 0x03
#define WC_RED_PALE 0x0c
#define CON_WHITE 0x07
#define CON_BLUE 0x03
#define CON_RED_PALE 0x0c
class CUI;
struct Color{
i16 def,highlight,lastColor;
Color():
def{WC_WHITE},highlight{WC_BLUE},lastColor{WC_WHITE}{}
Color(i16 def=WC_WHITE,i16 highlight=WC_BLUE):
def{def},highlight{highlight},lastColor{WC_WHITE}{}
def{CON_WHITE},highlight{CON_BLUE},lastColor{CON_WHITE}{}
Color(i16 def=CON_WHITE,i16 highlight=CON_BLUE):
def{def},highlight{highlight},lastColor{CON_WHITE}{}
auto setDefault(){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),def);
lastColor=def;
Expand Down Expand Up @@ -173,7 +173,7 @@ class CUI{
CUI():
height{},width{}{}
~CUI(){}
auto push(cstr text,fnptr fn=nullptr,i16 colorHighlight=WC_BLUE,i16 colorDef=WC_WHITE)->CUI&{
auto push(cstr text,fnptr fn=nullptr,i16 colorHighlight=CON_BLUE,i16 colorDef=CON_WHITE)->CUI&{
lineData.push_back(Text(text,Color(colorDef,(fn==nullptr)?(colorDef):(colorHighlight)),fn));
return *this;
}
Expand Down

0 comments on commit dbefd6b

Please sign in to comment.