コード例 #1
0
const AttachmentStrategy * AttachmentStrategy::create( const QString & type ) {
  QString lowerType = type.toLower();
  if ( lowerType == "iconic" )  return iconic();
  //if ( lowerType == "smart" )   return smart(); // not needed, see below
  if ( lowerType == "inlined" ) return inlined();
  if ( lowerType == "hidden" )  return hidden();
  // don't kFatal here, b/c the strings are user-provided
  // (KConfig), so fail gracefully to the default:
  return smart();
}
コード例 #2
0
const AttachmentStrategy * AttachmentStrategy::create( Type type ) {
  switch ( type ) {
  case Iconic:  return iconic();
  case Smart:   return smart();
  case Inlined: return inlined();
  case Hidden:  return hidden();
  }
  kFatal( 5006 ) << "Unknown attachment startegy ( type =="
                  << (int)type << ") requested!";
  return 0; // make compiler happy
}
コード例 #3
0
ファイル: motproc.c プロジェクト: svn2github/iup-iup
void iupmotCBstructure (Widget w, XtPointer data, XEvent *ev, Boolean *cont)
{
  Ihandle *n = (Ihandle*)data;
  Widget form = XtNameToWidget((Widget)handle(n),"*dialog_area");
  Iwidgetdata *wd;
  int state = -1;
  if (!form) return;
  XtVaGetValues (form, XmNuserData, &wd, NULL);
  if (!wd) return;

  switch(ev->type)
  {
    case MapNotify:
    {
      if ( iconic( wd->data ) ) /* IUP_RESTORE */
      {
        wd->data = (void*)(-((long)wd->data));
        state = IUP_RESTORE;
      }
      else /* IUP_SHOW */
      {
        Ihandle *startfocus = IupGetAttributeHandle(n, "STARTFOCUS");
        if (startfocus)
          IupSetFocus(startfocus);

        state = IUP_SHOW;
        iupmot_nvisiblewin++;
      }
      break;
    }

    case UnmapNotify:
    {
      if ( shown(wd->data) || popuped(wd->data) ) /* IUP_MINIMIZE */
      {
        wd->data = (void*)(-((long)wd->data));
        state = IUP_MINIMIZE;
      }
      break;
    }
  }
  {
    IFni cb = (IFni)IupGetCallback(n, IUP_SHOW_CB);
    if (cb && state>=0)
    {
      iupmot_incallback = TRUE;
      if (cb(n, state) == IUP_CLOSE) 
        iupmot_exitmainloop = 1;
      iupmot_incallback = FALSE;
    }
  }
}
コード例 #4
0
 const AttachmentStrategy * prev() const { return iconic(); }
コード例 #5
0
 const AttachmentStrategy * next() const { return iconic(); }