搜索
bottom↓
回复: 7

STemwin在103ze上显示checkbox没有pc仿真时大,可能是什么原因?

[复制链接]

出0入36汤圆

发表于 2019-8-12 22:06:06 | 显示全部楼层 |阅读模式
在GUIBuilder 和CodeBlocks仿真正常显示,在STM32103硬件平台上那个框小了很多。

GUIBuilder 图:


实际103硬件运行显示图:


另外实际板子上显示的外形,和PC上的外形也不同。是每个控件都需要设置下皮肤吗?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

阿莫论坛20周年了!感谢大家的支持与爱护!!

月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!

出0入36汤圆

 楼主| 发表于 2019-8-12 22:08:52 | 显示全部楼层
这是用GUIBuilder生成的C文件
/*********************************************************************
*                                                                    *
*                SEGGER Microcontroller GmbH & Co. KG                *
*        Solutions for real time microcontroller applications        *
*                                                                    *
**********************************************************************
*                                                                    *
* C-file generated by:                                               *
*                                                                    *
*        GUI_Builder for emWin version 5.38                          *
*        Compiled Nov 24 2016, 16:57:40                              *
*        (c) 2016 Segger Microcontroller GmbH & Co. KG               *
*                                                                    *
**********************************************************************
*                                                                    *
*        Internet: www.segger.com  Support: support@segger.com       *
*                                                                    *
**********************************************************************
*/

// USER START (Optionally insert additional includes)
// USER END

#include "DIALOG.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
#define ID_FRAMEWIN_0   (GUI_ID_USER + 0x00)
#define ID_DROPDOWN_0   (GUI_ID_USER + 0x01)
#define ID_DROPDOWN_1   (GUI_ID_USER + 0x02)
#define ID_TEXT_0   (GUI_ID_USER + 0x03)
#define ID_TEXT_1   (GUI_ID_USER + 0x05)
#define ID_CHECKBOX_0   (GUI_ID_USER + 0x06)
#define ID_CHECKBOX_1   (GUI_ID_USER + 0x07)
#define ID_DROPDOWN_2   (GUI_ID_USER + 0x08)
#define ID_DROPDOWN_3   (GUI_ID_USER + 0x09)


// USER START (Optionally insert additional defines)
// USER END

/*********************************************************************
*
*       Static data
*
**********************************************************************
*/

// USER START (Optionally insert additional static data)
// USER END

/*********************************************************************
*
*       _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
  { FRAMEWIN_CreateIndirect, "CurrentOutWin", ID_FRAMEWIN_0, 0, 1, 320, 240, 0, 0x0, 0 },
  { DROPDOWN_CreateIndirect, "Dropdown", ID_DROPDOWN_0, 33, 100, 118, 21, 0, 0x0, 0 },
  { DROPDOWN_CreateIndirect, "Dropdown", ID_DROPDOWN_1, 33, 139, 118, 21, 0, 0x0, 0 },
  { TEXT_CreateIndirect, "Text", ID_TEXT_0, 48, 8, 80, 35, 0, 0x64, 0 },
  { TEXT_CreateIndirect, "Text", ID_TEXT_1, 184, 6, 80, 35, 0, 0x64, 0 },
  { CHECKBOX_CreateIndirect, "Checkbox", ID_CHECKBOX_0, 35, 51, 112, 35, 0, 0x0, 0 },
  { CHECKBOX_CreateIndirect, "Checkbox", ID_CHECKBOX_1, 166, 51, 113, 35, 0, 0x0, 0 },
  { DROPDOWN_CreateIndirect, "Dropdown", ID_DROPDOWN_2, 164, 99, 118, 21, 0, 0x0, 0 },
  { DROPDOWN_CreateIndirect, "Dropdown", ID_DROPDOWN_3, 164, 140, 118, 21, 0, 0x0, 0 },
  // USER START (Optionally insert additional widgets)
  // USER END
};

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/

// USER START (Optionally insert additional static code)
// USER END

/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;
  // USER START (Optionally insert additional variables)
  // USER END

  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:
    //
    // Initialization of 'CurrentOutWin'
    //
    hItem = pMsg->hWin;
    FRAMEWIN_SetTitleHeight(hItem, 35);
    FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    FRAMEWIN_SetFont(hItem, GUI_FONT_32_ASCII);
    //
    // Initialization of 'Dropdown'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_0);
    DROPDOWN_SetFont(hItem, GUI_FONT_16_ASCII);
    //
    // Initialization of 'Dropdown'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_1);
    DROPDOWN_SetFont(hItem, GUI_FONT_16_ASCII);
    //
    // Initialization of 'Text'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
    TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    TEXT_SetText(hItem, "OUT1");
    TEXT_SetFont(hItem, GUI_FONT_32_ASCII);
    //
    // Initialization of 'Text'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
    TEXT_SetFont(hItem, GUI_FONT_32_ASCII);
    TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    TEXT_SetText(hItem, "OUT2");
    //
    // Initialization of 'Checkbox'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_0);
    CHECKBOX_SetText(hItem, "NG");
    CHECKBOX_SetFont(hItem, GUI_FONT_32_ASCII);
    //
    // Initialization of 'Checkbox'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_1);
    CHECKBOX_SetText(hItem, "OK");
    CHECKBOX_SetFont(hItem, GUI_FONT_32_ASCII);
    //
    // Initialization of 'Dropdown'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_2);
    DROPDOWN_SetFont(hItem, GUI_FONT_16_ASCII);
    //
    // Initialization of 'Dropdown'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_3);
    DROPDOWN_SetFont(hItem, GUI_FONT_16_ASCII);
    // USER START (Optionally insert additional code for further widget initialization)
    // USER END
    break;
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case ID_DROPDOWN_0: // Notifications sent by 'Dropdown'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_DROPDOWN_1: // Notifications sent by 'Dropdown'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_CHECKBOX_0: // Notifications sent by 'Checkbox'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_CHECKBOX_1: // Notifications sent by 'Checkbox'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_DROPDOWN_2: // Notifications sent by 'Dropdown'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_DROPDOWN_3: // Notifications sent by 'Dropdown'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SEL_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    // USER START (Optionally insert additional code for further Ids)
    // USER END
    }
    break;
  // USER START (Optionally insert additional message handling)
  // USER END
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       CreateCurrentOutWin
*/
WM_HWIN CreateCurrentOutWin(void);
WM_HWIN CreateCurrentOutWin(void) {
  WM_HWIN hWin;

  hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
  return hWin;
}

// USER START (Optionally insert additional public code)
// USER END

/*************************** End of file ****************************/

出0入8汤圆

发表于 2019-8-13 08:44:19 | 显示全部楼层
你这种情况,就是下位机没启用皮肤。(用的是默认皮肤)


查看你用的emwin版本,下位机和PC仿真用的版本是否一致,配置是否一致。

版本正常,开启皮肤就行了


出0入36汤圆

 楼主| 发表于 2019-8-13 15:21:40 | 显示全部楼层
Jmhh247 发表于 2019-8-13 08:44
你这种情况,就是下位机没启用皮肤。(用的是默认皮肤)

皮肤和 控件的大小也有关吗? 我一直以为皮肤不影响大小只是影响外观。

出0入8汤圆

发表于 2019-8-14 08:36:02 | 显示全部楼层
GZZXB 发表于 2019-8-13 15:21
皮肤和 控件的大小也有关吗? 我一直以为皮肤不影响大小只是影响外观。

当然有关了。


看图,上面的正常的皮肤色,下面是经典皮肤:

  



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入36汤圆

 楼主| 发表于 2019-8-19 08:53:35 | 显示全部楼层

感谢回复。 请问这个皮肤有没有省事的设置,比如用一个API设置所有控件都是某种皮肤?还是得一个一个控件的去设置呢?

出0入8汤圆

发表于 2019-8-19 10:17:15 | 显示全部楼层
GZZXB 发表于 2019-8-19 08:53
感谢回复。 请问这个皮肤有没有省事的设置,比如用一个API设置所有控件都是某种皮肤?还是得一个一个控件 ...


好像emwin5.28(具体版本记不清了)以后的版本默认就是开启皮肤了,看你PC仿真用的是5.38皮肤默认就是开启的。

所以前面回复,让你查看下位机emwin的版本了

API有可以设置一类控件为统一皮肤的,具体你看emwin手册吧,写的很清楚。


建议把手册系统的看一遍,就都明白了。






出0入36汤圆

 楼主| 发表于 2019-8-19 12:38:18 | 显示全部楼层
Jmhh247 发表于 2019-8-19 10:17
好像emwin5.28(具体版本记不清了)以后的版本默认就是开启皮肤了,看你PC仿真用的是5.38皮肤默认就是开启 ...

     下位机和上位机的文件是同一个压缩包解压出来的,按理说应该是一致的。
因为时间有点紧,没有认真的去看手册。 看来还是得花时间从头看一遍。为了显示
汉字后面搞出一大堆其他问题出来,有点郁闷了
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-27 11:24

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表