Example #1
0
/* ---------------------------------------------------------------------
 * PasswddlgCreateHook
 * Create dialog controls
 * ---------------------------------------------------------------------
 */
static void
PasswddlgCreateHook(void* w)
{
	CUIWINDOW* win = (CUIWINDOW*) w;
	CUIWINDOW* ctrl;
	PASSWDDLGDATA* data = (PASSWDDLGDATA*) win->InstData;

	ctrl = LabelNew(win, _T("Enter Password:"******"Retype Password:"******"&OK"), 14, 6, 10, 1, IDOK, CWS_DEFOK, CWS_NONE);
	ButtonSetClickedHook(ctrl, PasswddlgButtonHook, win);
	WindowCreate(ctrl);

	ctrl = ButtonNew(win, _T("&Cancel"), 27, 6, 10, 1, IDCANCEL, CWS_DEFCANCEL, CWS_NONE);
	ButtonSetClickedHook(ctrl, PasswddlgButtonHook, win);
	WindowCreate(ctrl);
}
Example #2
0
/*-----------------------------------------------------------------------------
*  create button event for application
*/
static void ButtonEvent(uint8_t address, uint8_t button) {
   TButtonEvent buttonEventData;

   if (ButtonNew(address, button) == true) {
      buttonEventData.address = spBusMsg->senderAddr;
      buttonEventData.pressed = true;
      buttonEventData.buttonNr = button;
      ApplicationEventButton(&buttonEventData);
   }
}
Example #3
0
void StartButtonInit(int height)
{
  Picture *p = NULL;
  int pw;

  /* some defaults */
  if (StartName  == NULL) UpdateString(&StartName, "Start");
  if (StartPopup == NULL) UpdateString(&StartPopup, "StartMenu");
  if (StartIconName == NULL) UpdateString(&StartIconName, "mini-start.xpm");

  p = GetPicture(dpy, Root, IconPath, PixmapPath, StartIconName);

  StartButton = (Button *)ButtonNew(StartName, p, BUTTON_UP, 0);
  if (p != NULL) pw = p->width+3; else pw = 0;
  StartButtonWidth = XTextWidth(ButtonFont, StartName, strlen(StartName)) + pw + 14;
  StartButtonHeight = height;
}
Example #4
0
File: Start.c Project: att/uwin
void StartButtonInit(int height)
{
  Picture *p = NULL;
  int pw;

  /* some defaults */
  if (StartName  == NULL)
    UpdateString(&StartName, "Start");
  if (StartPopup == NULL)
    UpdateString(&StartPopup, "StartMenu");
  if (StartIconName == NULL)
    UpdateString(&StartIconName, "mini-start.xpm");

  /** FIXME: what should the colour limit be?
      I put in -1, which apparently imposes NO limit.
  **/
  p = GetPicture(dpy, win, ImagePath, StartIconName, -1);

  StartButton = (Button *)ButtonNew(StartName, p, BUTTON_UP,0);
  if (p != NULL) pw = p->width+3; else pw = 0;
  StartButtonWidth = XTextWidth(ButtonFont, StartName, strlen(StartName)) +
    pw + 14;
  StartButtonHeight = height;
}
Example #5
0
void StartButtonInit(int height)
{
  FvwmPicture *p = NULL;
  int pw;
  FvwmPictureAttributes fpa;
  StartAndLaunchButtonItem *tempPtr;

  fpa.mask = FPAM_NO_ALLOC_PIXELS;

  /* if no start button params were specified, trick the program into
   * thinking that they were */
  if (First_Start_Button == NULL && !NoDefaultStartButton)
  {
    StartButtonParseConfig("*FvwmTaskBarStartName Start");
    StartButtonParseConfig("*FvwmTaskBarStartMenu RootMenu");
    StartButtonParseConfig("*FvwmTaskBarStartIcon mini.start.xpm");
  }
  /* some defaults */
  if (First_Start_Button && First_Start_Button->isStartButton == True)
  {
    if (First_Start_Button->buttonCaption == NULL)
      UpdateString(&(First_Start_Button->buttonCaption), "Start");
    if (First_Start_Button->buttonIconFileName == NULL)
      UpdateString(&(First_Start_Button->buttonIconFileName), "mini-start.xpm");
  }

  tempPtr = First_Start_Button;

  while(tempPtr != NULL)
  {
	  p = PGetFvwmPicture(
		  dpy, win, ImagePath, tempPtr->buttonIconFileName, fpa);
	  if (p != NULL && strlen(tempPtr->buttonCaption) != 0)
	  {
		  /* icon and title */
		  pw = p->width + 12;
	  }
	  else if (p != NULL)
	  {
		  /* just icon */
		  pw = p->width + 8;
	  }
	  else
	  {
		  /* just title */
		  pw = 10;
	  }

    tempPtr->buttonItem = (Button *)ButtonNew(
	    tempPtr->buttonCaption, p, BUTTON_UP,0);
    if (tempPtr->isStartButton)
    {
	    StartButton = tempPtr->buttonItem;
	    tempPtr->width = FlocaleTextWidth(
		    FSelButtonFont, tempPtr->buttonCaption,
		    strlen(tempPtr->buttonCaption)) + pw;
    }
    else
    {
	    tempPtr->width = FlocaleTextWidth(
		    FButtonFont, tempPtr->buttonCaption,
		    strlen(tempPtr->buttonCaption)) + pw;
    }
    tempPtr->height = height;
    StartAndLaunchButtonsWidth += tempPtr->width;
    tempPtr=tempPtr->tail;
    PFreeFvwmPictureData(p); /* should not destroy of course */
  }
  if (First_Start_Button)
  {
	  StartAndLaunchButtonsWidth += StartButtonRightMargin;
	  First_Start_Button->height = height;
	  StartAndLaunchButtonsHeight = First_Start_Button->height;
  }
  else
  {
    StartAndLaunchButtonsWidth = 0;
    StartButtonRightMargin = 0;
    if (has_wb_left_margin == 0)
    {
      WindowButtonsLeftMargin = 0;
    }
    if (has_wb_right_margin == 0)
    {
      WindowButtonsRightMargin = 0;
    }
  }
}