|
中国象棋控件 2.0.15
|
中国象棋窗体,完成中国象棋的界面 更多...
#include <FrmChineseChess.h>


信号 | |
| void | sigGoChess (int i, int j, CPiece::ENUM_QiZi chess) |
Public 成员函数 | |
| CFrmChineseChess (QWidget *parent=nullptr) | |
| void | AboutBox () |
棋局信息 | |
| QDateTime | GetStartTime () |
| 得到开始时间 | |
| int | SetStartTime (const QDateTime &t) |
| QDateTime | GetEndTime () |
| int | SetEndTime (const QDateTime &t) |
| QString | GetRedName () |
| int | SetRedName (const QString &name) |
| QString | GetBlackName () |
| int | SetBlackName (const QString &name) |
Public 成员函数 继承自 CChineseChess | |
| int | SetBoardLayout (ENUM_BoardLayout layout) |
| ENUM_BoardLayout | GetBoardLayout () |
| bool | GoChess (int i, int j, bool bNext=false) |
| 走棋 | |
| int | NextStep () |
| 函数名:NextStep 功 能:下步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:33 | |
| int | PreviouStep () |
| 函数名:PreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51 | |
| virtual int | SaveChessGame (const char *pszFile) |
| 保存棋局。 根据文件扩展名来保存为相应的格式。 当前支持自定义格式、PGN格式 | |
| virtual int | LoadChessGame (const char *pszFile) |
| 加载棋局。 根据文件扩展名来解析文件的格式。 当前支持自定义格式、PGN格式 | |
| time_t | GetStartTime () |
| int | SetStartTime (const time_t &t) |
| time_t | GetEndTime () |
| int | SetEndTime (const time_t &t) |
| std::string | GetRedName () |
| int | SetRedName (const char *pszName) |
| std::string | GetBlackName () |
| int | SetBlackName (const char *pszName) |
| std::string | GetGameTag (const std::string &tag) |
| int | AddGameTag (const std::string &szTag, const std::string &szVal) |
| int | EnablePromptSound (bool sound=true) |
| bool | getEnablePromptSound () |
| int | EnablePromptMessage (bool bMsg=true) |
| bool | getEnablePromptMessage () |
静态 Public 成员函数 | |
资源 | |
| static int | InitResource (const QString szLanguage) |
| 初始化资源,仅在程序开始时调用一次 | |
| static int | CleanResource () |
| 清理资源,仅在程序结束时调用一次 | |
Protected 成员函数 | |
| virtual void | mouseReleaseEvent (QMouseEvent *event) override |
| virtual void | paintEvent (QPaintEvent *event) override |
| virtual void | resizeEvent (QResizeEvent *event) override |
| virtual int | onPromptSound (PROMPT_SOUND sound) override |
| virtual int | onPromptMessage (CGoRule::ENUM_ReturnValue val) override |
| 提示错误消息 | |
| virtual int | onCleanPrompt (int i, int j) override |
| 清除提示框 | |
| virtual int | onDrawPrompt (int i, int j) override |
| 画提示框 | |
| virtual int | onGoChess (int i, int j, CPiece::ENUM_QiZi chess) override |
| 走棋事件 | |
Protected 成员函数 继承自 CChineseChess | |
| int | CleanPrompt (int &i, int &j) |
| 清理提示,并把提示框位置设置成无效值 | |
| bool | IsValidPosition (int i, int j) |
| int | Initial () |
| int | ConvertQiPang (const int &i, const int &j, int &x, int &y) |
属性 | |
| QString | RedName |
| QString | BlackName |
| QDateTime | StartTime |
| QDateTime | EndTime |
Private 类型 | |
| enum | ENUM_ConvertCoordinate { XYToIJ , IJToXY } |
| 坐标转换 更多... | |
| enum | ENUM_XINWEI { XinWei , Left_XinWei , Right_XinWei } |
| 棋盘星位 更多... | |
Private 成员函数 | |
| bool | ConvertCoordinate (long *x, long *y, int *i, int *j, ENUM_ConvertCoordinate eCC=XYToIJ) |
| 坐标转换 | |
| bool | SetQiPang (int width, int height) |
| 设置棋盘位置 | |
| void | DrawXinWei (QPainter *pPainter, int i, int j, ENUM_XINWEI xinwei=XinWei) |
| 画星位 | |
| bool | DrawTiShiBox (QPainter *pPainter, int i, int j) |
| 画提示框 | |
| int | DrawQiZi (QPainter *pPainter, int i, int j, CPiece::ENUM_QiZi eQiZi) |
| 画棋子 | |
| void | DrawQiPang (QPainter *pPainter, QRect rect) |
| 画棋盘 | |
| int | DrawPicture (QPainter *pPainter, int i, int j, QImage image, bool CHHJKL=false) |
| 画图片 | |
| int | DrawImage (QPainter *pPainter, QRect rect, QImage image) |
| 在指定位置绘图 | |
| int | SetTransparentImage (QImage &image, const QColor &col=QColor(255, 255, 255)) |
| 设置 QImage 透明 | |
| int | SetTransparentPixmap (QPixmap &pixmap, const QColor &col=QColor(255, 255, 255)) |
| 设置 Pixmap 透明 | |
Private 属性 | |
| Ui::CFrmChineseChess * | ui |
| int | m_QiPangStartX |
| 棋盘的开始横坐标 | |
| int | m_QiPangStartY |
| 棋盘的开始横坐标 | |
| int | m_QiPangDistance |
| 棋盘格的距离 | |
| QColor | m_QiPangColor |
| 棋盘格的颜色 | |
| QColor | m_TiShiBoxColor |
| 提示框的颜色 | |
| QImage | m_QiPangPicture |
| 棋盘背景图片 | |
棋子图片 | |
| QImage | m_RedShuai |
| 红帅 | |
| QImage | m_RedShi |
| 红仕 | |
| QImage | m_RedXiang |
| 红相 | |
| QImage | m_RedMa |
| 红马 | |
| QImage | m_RedChe |
| 红车 | |
| QImage | m_RedBing |
| 红兵 | |
| QImage | m_RedPao |
| 红炮 | |
| QImage | m_BlackShuai |
| 黑帅 | |
| QImage | m_BlackShi |
| 黑仕 | |
| QImage | m_BlackXiang |
| 黑相 | |
| QImage | m_BlackMa |
| 黑马 | |
| QImage | m_BlackChe |
| 黑车 | |
| QImage | m_BlackBing |
| 黑兵 | |
| QImage | m_BlackPao |
| 黑炮 | |
楚河汉界图片 | |
| QImage | m_Chu |
| 楚 | |
| QImage | m_He |
| 河 | |
| QImage | m_Han |
| 汉 | |
| QImage | m_Jie |
| 界 | |
| QImage | m_KL |
| 版本图片 | |
额外继承的成员函数 | |
Public 类型 继承自 CChineseChess | |
| enum | _ENUM_BoardLayout { NoQi = 0 , OnlyTopBlack = 1 , OnlyBottomRed = 2 , SwapRedBetweenBlack = 4 , OnlyTopRed = OnlyBottomRed | SwapRedBetweenBlack , OnlyBottomBlack = OnlyTopBlack | SwapRedBetweenBlack , TopBlackAndBottomRed = OnlyTopBlack | OnlyBottomRed , TopRedAndBottomBlack = TopBlackAndBottomRed | SwapRedBetweenBlack } |
| 标准棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条。红棋在下,黑棋在上。 界面可以支持非标准棋盘布局(红在上,黑在下) 更多... | |
| typedef enum CChineseChess::_ENUM_BoardLayout | ENUM_BoardLayout |
| 标准棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条。红棋在下,黑棋在上。 界面可以支持非标准棋盘布局(红在上,黑在下) | |
Protected 类型 继承自 CChineseChess | |
| enum | PROMPT_SOUND { JiangJun , Eat , Go , NoGo , Select } |
| 提示音 更多... | |
| enum | _ENUM_WalkState { RedReadly , RedWalked , BlackReadly , BlackWalked } |
| typedef enum CChineseChess::_ENUM_WalkState | ENUM_WalkState |
Protected 属性 继承自 CChineseChess | |
| CPiece::ENUM_QiZi | m_ChessBoard [9][10] |
| 棋盘描述 | |
| ENUM_BoardLayout | m_BoardLayout |
| ENUM_WalkState | m_WalkState |
| int | m_PreviouPositionX |
| int | m_PreviouPositionY |
| int | m_CurrentPositionX |
| int | m_CurrentPositionY |
中国象棋窗体,完成中国象棋的界面
在文件 FrmChineseChess.h 第 25 行定义.
|
private |
坐标转换
在文件 FrmChineseChess.h 第 128 行定义.
|
private |
棋盘星位
在文件 FrmChineseChess.h 第 133 行定义.
|
explicit |
在文件 FrmChineseChess.cpp 第 19 行定义.
|
overridevirtual |
在文件 FrmChineseChess.cpp 第 73 行定义.
| void CFrmChineseChess::AboutBox | ( | ) |
在文件 FrmChineseChess.cpp 第 217 行定义.
|
static |
清理资源,仅在程序结束时调用一次
在文件 FrmChineseChess.cpp 第 95 行定义.
|
private |
坐标转换
| x | 设备横坐标 |
| y | 设备纵坐标 |
| i | 棋盘横坐标[0,8] |
| j | 棋盘纵坐标[0,9] |
| eCC | 转换方式
|
在文件 FrmChineseChess.cpp 第 289 行定义.
|
private |
|
private |
画图片
| pPainter | |
| i | 图片位置横坐标[0-8] |
| j | 图片位置纵坐标[0-9] |
| image | 图片 |
| CHHJKL | 画楚河汉界(默认值为 false) |
在文件 FrmChineseChess.cpp 第 627 行定义.
|
private |
|
private |
画棋子
| pPainter | 设备上下文 |
| i | 棋盘横坐标[0-8] |
| j | 棋盘纵坐标[0-9] |
| eQiZi | 棋子 |
在文件 FrmChineseChess.cpp 第 556 行定义.
|
private |
画提示框
| pPainter | 设备上下文 |
| i | 棋盘横坐标[0-8] |
| j | 棋盘纵坐标[0-9] |
在文件 FrmChineseChess.cpp 第 517 行定义.
|
private |
画星位
| pPainter | 设备上下文 |
| i | 星位的横坐标[0-8] |
| j | 星位的纵坐标[0-9] |
| xinwei | 画的位置取下列值勤之一:
|
在文件 FrmChineseChess.cpp 第 473 行定义.
| QString CFrmChineseChess::GetBlackName | ( | ) |
在文件 FrmChineseChess.cpp 第 268 行定义.
| QDateTime CFrmChineseChess::GetEndTime | ( | ) |
在文件 FrmChineseChess.cpp 第 246 行定义.
| QString CFrmChineseChess::GetRedName | ( | ) |
在文件 FrmChineseChess.cpp 第 258 行定义.
| QDateTime CFrmChineseChess::GetStartTime | ( | ) |
得到开始时间
在文件 FrmChineseChess.cpp 第 233 行定义.
|
static |
|
overrideprotectedvirtual |
在文件 FrmChineseChess.cpp 第 106 行定义.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
实现了 CChineseChess.
在文件 FrmChineseChess.cpp 第 136 行定义.
|
overrideprotectedvirtual |
在文件 FrmChineseChess.cpp 第 120 行定义.
|
overrideprotectedvirtual |
在文件 FrmChineseChess.cpp 第 130 行定义.
| int CFrmChineseChess::SetBlackName | ( | const QString & | name | ) |
在文件 FrmChineseChess.cpp 第 273 行定义.
| int CFrmChineseChess::SetEndTime | ( | const QDateTime & | t | ) |
在文件 FrmChineseChess.cpp 第 253 行定义.
|
private |
设置棋盘位置
| width | 控件窗口宽度 |
| height | 控件窗口高度 |
在文件 FrmChineseChess.cpp 第 311 行定义.
| int CFrmChineseChess::SetRedName | ( | const QString & | name | ) |
在文件 FrmChineseChess.cpp 第 263 行定义.
| int CFrmChineseChess::SetStartTime | ( | const QDateTime & | t | ) |
在文件 FrmChineseChess.cpp 第 241 行定义.
|
private |
|
private |
|
private |
黑兵
在文件 FrmChineseChess.h 第 111 行定义.
|
private |
黑车
在文件 FrmChineseChess.h 第 110 行定义.
|
private |
黑马
在文件 FrmChineseChess.h 第 109 行定义.
|
private |
黑炮
在文件 FrmChineseChess.h 第 112 行定义.
|
private |
黑仕
在文件 FrmChineseChess.h 第 107 行定义.
|
private |
黑帅
在文件 FrmChineseChess.h 第 106 行定义.
|
private |
黑相
在文件 FrmChineseChess.h 第 108 行定义.
|
private |
楚
在文件 FrmChineseChess.h 第 119 行定义.
|
private |
汉
在文件 FrmChineseChess.h 第 121 行定义.
|
private |
河
在文件 FrmChineseChess.h 第 120 行定义.
|
private |
界
在文件 FrmChineseChess.h 第 122 行定义.
|
private |
版本图片
在文件 FrmChineseChess.h 第 123 行定义.
|
private |
棋盘格的颜色
在文件 FrmChineseChess.h 第 89 行定义.
|
private |
棋盘格的距离
在文件 FrmChineseChess.h 第 87 行定义.
|
private |
棋盘背景图片
在文件 FrmChineseChess.h 第 92 行定义.
|
private |
棋盘的开始横坐标
在文件 FrmChineseChess.h 第 85 行定义.
|
private |
棋盘的开始横坐标
在文件 FrmChineseChess.h 第 86 行定义.
|
private |
红兵
在文件 FrmChineseChess.h 第 103 行定义.
|
private |
红车
在文件 FrmChineseChess.h 第 102 行定义.
|
private |
红马
在文件 FrmChineseChess.h 第 101 行定义.
|
private |
红炮
在文件 FrmChineseChess.h 第 104 行定义.
|
private |
红仕
在文件 FrmChineseChess.h 第 99 行定义.
|
private |
红帅
在文件 FrmChineseChess.h 第 98 行定义.
|
private |
红相
在文件 FrmChineseChess.h 第 100 行定义.
|
private |
提示框的颜色
在文件 FrmChineseChess.h 第 90 行定义.
|
private |
在文件 FrmChineseChess.h 第 83 行定义.
|
readwrite |
在文件 FrmChineseChess.h 第 30 行定义.
|
readwrite |
在文件 FrmChineseChess.h 第 32 行定义.
|
readwrite |
在文件 FrmChineseChess.h 第 29 行定义.
|
readwrite |
在文件 FrmChineseChess.h 第 31 行定义.