/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Toolbar trouble

Username:     
Password:     
             

Forum

# 1   2010-09-30 07:29:25 Toolbar trouble

rikubon
Member
Registered: 2009-08-21
Posts: 16

Toolbar trouble

When I load a simple test program shown below, which is to test the toolbar and menu with Primer2, everything works fine.

However, when I copy & paste the code into my DSO (digital sampling oscilloscope) program , the toolbar does not work at all. In addition, before launching the DSO, the toolbar on the main page works normally. But after quiting the DSO, it does not work at all **EVEN ON THE MAIN PAGE*.

Regarding to the toolbar, both programs, the test program below and the DSO program, contains completely the same codes.

Could someone please give me a help?

Code:

enum MENU_code fStart(void);
enum MENU_code fStop(void);
enum MENU_code Item1_Ini(void);
enum MENU_code Item1_Handler(void);
enum MENU_code fQuit(void);

const char Application_Name[8+1] = {"MenuTScr"};      // Max 8 characters

// Icon definitions for Toolbar
static const u16 ButtonStartBmp [] = {
#include "icon\Start-32x32.h"
    };

static const u16 ButtonStopBmp [] = {
#include "icon\Stop-32x32.h"
    };

tMenu myMenu = {
  1,"my MENU",2,0,0,0,0,0,0,{
    { "CircleOS Ver.", Item1_Ini, Item1_Handler , 0 },
    { "Quit",     fQuit, 0, 1 }
  }
};

tToolbar myToolbar =
    {
    2,
        0,
        {
            { ButtonStartBmp,  fStart },
            { ButtonStopBmp,  fStop  },
        }
    };

enum MENU_code fQuit (void)
{
    BUTTON_SetMode( BUTTON_ONOFF_FORMAIN);
    TOOLBAR_SetDefaultToolbar();
    return MENU_Quit();
}

enum MENU_code fStart (void)
{
  DRAW_DisplayString( 40,  60, "START", 17 );    
  BUZZER_SetMode( BUZZER_SHORTBEEP );
  BUZZER_SetMode( BUZZER_SHORTBEEP );
}

enum MENU_code fStop (void)
{
  DRAW_DisplayString( 40,  60, "STOP", 17 );        
  BUZZER_SetMode( BUZZER_LONGBEEP );
}

enum MENU_code Item1_Ini(void)
{
  return MENU_CONTINUE_COMMAND;
}

enum MENU_code Item1_Handler(void)
{
   // some lines to do some tasks
   BUZZER_SetMode( BUZZER_SHORTBEEP );
   BUTTON_SetMode( BUTTON_ONOFF );
   DRAW_Clear();
   DRAW_DisplayString( 5,  70, "CircleOS", 17 );
   DRAW_DisplayString( 80, 70, UTIL_GetVersion(), 6 );
   return MENU_RESTORE_COMMAND;
}

enum MENU_code Application_Ini(void)
    {
    TOOLBAR_Set(&myToolbar);

    return MENU_CONTINUE_COMMAND;
    }

enum MENU_code Application_Handler(void)
{

  if(BUTTON_GetState() == BUTTON_PUSHED) {
    BUTTON_WaitForRelease();
    MENU_Set( &myMenu );
    return MENU_CHANGE;
  }
  return MENU_CONTINUE;   // Returning MENU_LEAVE will quit to CircleOS
}

Last edited by rikubon (2010-09-30 07:36:27)

Offline

 

# 2   2010-09-30 07:52:01 Toolbar trouble

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Toolbar trouble

Which version of CircleOS do you use ?
Could you try with a 4 buttons toolbar (set the last item icons and functions pointers to 0)

Offline

 

# 3   2010-09-30 08:22:54 Toolbar trouble

rikubon
Member
Registered: 2009-08-21
Posts: 16

Re: Toolbar trouble

Thank you yrt.

I tried both V3.8 and V4.1 and got the same result in both cases.
Nothing happened by adding more two buttons setting pointers 0.
Any more hints would be greatly appreciated.

Thanks

Offline

 

Board footer