想着给12864写个UI界面的,使用的是IIC接口12864液晶屏,节省了IO口但是液晶数据无法读回来,所以就在单片机中开辟了一个[8][128]数组,用了1k的RAM显存图像数据。
写了windows风格界面的窗体,支持 标题前插入图标,标题,最大化、最小化、叉叉图标。
支持任意大小横向进度条。
支持按钮,按钮标题,按钮按下放开效果。
支持文本下拉条,可显示在上下左右,自适应窗体大小。
支持多窗体显示,移动窗体,后面的窗体会覆盖前面的。
加入内存卡中文字库支持后,可以直接显示中文字符。
gs_form.Left = 0;
gs_form.Top = 0;
gs_form.Width = 128;
gs_form.Height = 64;
gs_form.BorderWidth = 2;
gs_form.Caption = "Main Form";
gs_form.CaptionHeight = 10;
gs_form.State = MinButton | MaxButton | EndButton;
gs_form.Style = 0;
gs_form.Icon = 1;
wzGUI_DrawForm(&gs_form);
gs_scrobar.direction = 0;
wzGUI_DrawScrollBar(&gs_form,&gs_scrobar);
wzGUI_DrawScrollBarSet(&gs_form,&gs_scrobar,4,2);
gs_button.x = 1;
gs_button.y = 10;
gs_button.width = 27;
gs_button.hight = 11;
gs_button.caption = "Menu";
wzGUI_DrawButton(&gs_form,&gs_button);
gs_button.x = 30;
gs_button.y = 10;
gs_button.width = 26;
gs_button.hight = 11;
gs_button.caption = "Set";
wzGUI_DrawButton(&gs_form,&gs_button);
gs_button.x = 58;
gs_button.y = 10;
gs_button.width = 27;
gs_button.hight = 11;
gs_button.caption = "Come";
wzGUI_DrawButton(&gs_form,&gs_button);
gs_button.x = 87;
gs_button.y = 10;
gs_button.width = 27;
gs_button.hight = 11;
gs_button.caption = "Home";
wzGUI_DrawButton(&gs_form,&gs_button);
wzGUI_DrawButtonDone(&gs_form,&gs_button);
gs_probar.x = 6;
gs_probar.y = 2;
gs_probar.width = 102;
gs_probar.hight = 5;
wzGUI_DrawProgressBar(&gs_form,&gs_probar);
wzGUI_DrawProgressBarSet(&gs_form,&gs_probar,80);
gs_form.Left = 5;
gs_form.Top = 29;
gs_form.Width = 110;
gs_form.Height = 31;
gs_form.BorderWidth = 1;
gs_form.Caption = "MsgBox";
gs_form.CaptionHeight = 10;
gs_form.State = EndButton;
gs_form.Style = 0;
gs_form.Icon = 0;
wzGUI_DrawForm(&gs_form);
DispBuf_SetFont(12);
DispBuf_SetXY(20,43);
DispBuf_Str("南京沁恒RISC-V");
OLED_SSD1306_DisBuf(gd_DispBuf);
|