野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11047|回复: 2

[STemWin]ICONVIEW:图标显示异常

[复制链接]
发表于 2017-5-14 22:52:09 | 显示全部楼层 |阅读模式
#include "DIALOG.h"
#include <includes.h>
/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
#define ID_FRAMEWIN_0 (GUI_ID_USER + 0x00)
#define ID_TEXT_0 (GUI_ID_USER + 0x01)
#define ID_ICONVIEW_0 (GUI_ID_USER + 0x02)


extern GUI_CONST_STORAGE GUI_BITMAP bm01;
extern GUI_CONST_STORAGE GUI_BITMAP bm02;
extern GUI_CONST_STORAGE GUI_BITMAP bm03;
extern GUI_CONST_STORAGE GUI_BITMAP bm04;
extern GUI_CONST_STORAGE GUI_BITMAP bm05;
extern GUI_CONST_STORAGE GUI_BITMAP bm06;
extern GUI_CONST_STORAGE GUI_BITMAP bm07;
extern GUI_CONST_STORAGE GUI_BITMAP bm08;
extern GUI_CONST_STORAGE GUI_BITMAP bm09;




// 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, "Framewin", ID_FRAMEWIN_0, 0, 0, 240, 320, 0, 0x0, 0 },
  { TEXT_CreateIndirect, "Text", ID_TEXT_0, 22, 259, 166, 31, 0, 0x64, 0 },
  { ICONVIEW_CreateIndirect, "Iconview", ID_ICONVIEW_0, 0, 0, 240, 250, 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;
     WM_HWIN IconviewWin;    //ICONVIEW控件窗口
  // USER START (Optionally insert additional variables)
  // USER END


  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:
    //
    // Initialization of 'Framewin'
    //
    hItem = pMsg->hWin;
    FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    //
    // Initialization of 'Text'
    //
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
    TEXT_SetFont(hItem, GUI_FONT_13H_ASCII);
    TEXT_SetText(hItem, "Text");
    TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
   
   
      hItem = WM_GetDialogItem(pMsg->hWin, ID_ICONVIEW_0);
        ICONVIEW_SetIconAlign(hItem, ICONVIEW_IA_TOP);
        ICONVIEW_SetTextColor(hItem, ICONVIEW_CI_UNSEL, GUI_BLUE);
        ICONVIEW_SetTextColor(hItem, ICONVIEW_CI_SEL, GUI_GREEN);
     
        ICONVIEW_SetFrame(hItem, GUI_COORD_X, 0);
        ICONVIEW_SetFrame(hItem, GUI_COORD_Y, 0);
        ICONVIEW_SetSpace(hItem, GUI_COORD_X, 65);   
        ICONVIEW_SetSpace(hItem, GUI_COORD_Y, 32);      
ICONVIEW_SetSpace
这个地方怎么修改都显示不正常,个朋友分析一下是什么问题
                                                                  
        ICONVIEW_SetFont(hItem, GUI_FONT_16_1);
        ICONVIEW_AddBitmapItem(hItem, &bm01, "neqee");
        ICONVIEW_AddBitmapItem(hItem, &bm02, "SOS");
        ICONVIEW_AddBitmapItem(hItem, &bm03, "Phone");
        ICONVIEW_AddBitmapItem(hItem, &bm04, "Camera");
        ICONVIEW_AddBitmapItem(hItem, &bm05, "Email");
        ICONVIEW_AddBitmapItem(hItem, &bm06, "NoteBook");
        ICONVIEW_AddBitmapItem(hItem, &bm07, "JTV");
        ICONVIEW_AddBitmapItem(hItem, &bm08, "Dollar");
    // 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_ICONVIEW_0: // Notifications sent by 'Iconview'
      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_MOVED_OUT:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_SCROLL_CHANGED:
        // 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
*
**********************************************************************
*/
/*********************************************************************
*
*       CreateFramewin
*/
WM_HWIN CreateFramewin(void);
WM_HWIN CreateFramewin(void) {
  WM_HWIN hWin;


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


        BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
        CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
        DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
        FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
        HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
        MENU_SetDefaultSkin(MENU_SKIN_FLEX);
        MULTIPAGE_SetDefaultSkin(MULTIPAGE_SKIN_FLEX);
        PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
        RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
        SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
        SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
        SPINBOX_SetDefaultSkin(SPINBOX_SKIN_FLEX);
   
   
      CreateFramewin();
   
      LCD_BK_OFF();
   
    while(1)
            GUI_Delay(100);


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


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

回复

使用道具 举报

发表于 2017-5-15 08:57:30 | 显示全部楼层
是怎么不正常?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-5-15 17:28:59 | 显示全部楼层
随风 发表于 2017-5-15 08:57
是怎么不正常?

不按规定显示,你看它显示到边缘了,有什么方法让它自动排序
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-11-27 23:57 , Processed in 0.029093 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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