当前位置: 首页>>代码示例>>C++>>正文


C++ SsdWidget::right_softkey_callback方法代码示例

本文整理汇总了C++中SsdWidget::right_softkey_callback方法的典型用法代码示例。如果您正苦于以下问题:C++ SsdWidget::right_softkey_callback方法的具体用法?C++ SsdWidget::right_softkey_callback怎么用?C++ SsdWidget::right_softkey_callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SsdWidget的用法示例。


在下文中一共展示了SsdWidget::right_softkey_callback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnKeyPressed

static BOOL OnKeyPressed( const char* utf8char, uint32_t flags) {
   BOOL        key_handled = TRUE;
   SsdWidget   in_focus    = NULL;

   if( !RoadMapDialogCurrent)
      return FALSE;

   // Let the control handle the key:
   in_focus = RoadMapDialogCurrent->in_focus;
   if( in_focus && ssd_widget_on_key_pressed (in_focus, utf8char, flags)) {
      roadmap_screen_redraw();
      return TRUE;
   }

   // The control did not handle the key...
   //    Supply general handling for virtual keys:
   if( KEYBOARD_VIRTUAL_KEY & flags)
   {
      SsdWidget container = RoadMapDialogCurrent->container;
      switch( *utf8char) {
         case VK_Back:
            ssd_dialog_hide_current(dec_cancel);
            break;

         case VK_Arrow_left:
            if( SSD_TAB_CONTROL & RoadMapDialogCurrent->container->flags)
               if (RoadMapDialogCurrent->scroll_container)
                  ssd_tabcontrol_move_tab_left( RoadMapDialogCurrent->scroll_container);
               else
                  ssd_tabcontrol_move_tab_left( RoadMapDialogCurrent->container);
            else
               ssd_dialog_move_focus(FOCUS_LEFT);
            break;

         case VK_Arrow_up:
            ssd_dialog_move_focus(FOCUS_UP);
            break;

         case VK_Arrow_right:
            if( SSD_TAB_CONTROL & RoadMapDialogCurrent->container->flags)
               if (RoadMapDialogCurrent->scroll_container)
                  ssd_tabcontrol_move_tab_right( RoadMapDialogCurrent->scroll_container);
               else
                  ssd_tabcontrol_move_tab_right( RoadMapDialogCurrent->container);
            else
               ssd_dialog_move_focus( FOCUS_RIGHT);
            break;

         case VK_Arrow_down:
            ssd_dialog_move_focus(FOCUS_DOWN);
            break;

         case VK_Softkey_right:
            if (RoadMapDialogCurrent->scroll_container && (RoadMapDialogCurrent->scroll_container->right_softkey_callback != NULL))
                     RoadMapDialogCurrent->scroll_container->right_softkey_callback(RoadMapDialogCurrent->scroll_container, RoadMapDialogCurrent->scroll_container->name, RoadMapDialogCurrent->scroll_container->context);
            else if (container->right_softkey_callback != NULL)
               container->right_softkey_callback(container, container->name, container->context);
            else
#ifdef TOUCH_SCREEN
               ssd_dialog_hide_current( dec_ok );
#else
               ssd_dialog_hide_current( dec_cancel );
#endif
            break;

         case VK_Softkey_left:
            if (RoadMapDialogCurrent->scroll_container && (RoadMapDialogCurrent->scroll_container->left_softkey_callback != NULL))
                     RoadMapDialogCurrent->scroll_container->left_softkey_callback(RoadMapDialogCurrent->scroll_container, RoadMapDialogCurrent->scroll_container->name, RoadMapDialogCurrent->scroll_container->context);
            else if (container->left_softkey_callback != NULL)
               container->left_softkey_callback(container, container->name, container->context);
            else
               ssd_dialog_hide_all(dec_cancel);
            break;

         default:
            key_handled = FALSE;
      }

   }
   else
   {
      assert(utf8char);
      assert(*utf8char);

      // Other special keys:
      if( KEYBOARD_ASCII & flags)
      {
         switch(*utf8char)
         {
            case ESCAPE_KEY:
               ssd_dialog_hide_current(dec_cancel);
               break;

            case TAB_KEY:
               ssd_dialog_move_focus(FOCUS_FORWARD);
               break;

            default:
               key_handled = FALSE;
         }
//.........这里部分代码省略.........
开发者ID:FlavioFalcao,项目名称:Freemap-waze,代码行数:101,代码来源:ssd_dialog.c


注:本文中的SsdWidget::right_softkey_callback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。