コード例 #1
0
nsresult nsPluginNativeWindowGtk::CallSetWindow(RefPtr<nsNPAPIPluginInstance> &aPluginInstance)
{
  if (aPluginInstance) {
    if (type == NPWindowTypeWindow &&
        XRE_IsContentProcess()) {
      // In this case, most of the initialization code here has already happened
      // in the chrome process. The window we have in content is the XID of the
      // socket widget we need to hand to plugins.
      SetWindow((XID)window);
	  } else if (type == NPWindowTypeWindow) {
      if (!mSocketWidget) {
        nsresult rv;

        // The documentation on the types for many variables in NP(N|P)_GetValue
        // is vague.  Often boolean values are NPBool (1 byte), but
        // https://developer.mozilla.org/en/XEmbed_Extension_for_Mozilla_Plugins
        // treats NPPVpluginNeedsXEmbed as PRBool (int), and
        // on x86/32-bit, flash stores to this using |movl 0x1,&needsXEmbed|.
        // thus we can't use NPBool for needsXEmbed, or the three bytes above
        // it on the stack would get clobbered. so protect with the larger bool.
        int needsXEmbed = 0;
        rv = aPluginInstance->GetValueFromPlugin(NPPVpluginNeedsXEmbed, &needsXEmbed);
        // If the call returned an error code make sure we still use our default value.
        if (NS_FAILED(rv)) {
          needsXEmbed = 0;
        }
#ifdef DEBUG
        printf("nsPluginNativeWindowGtk: NPPVpluginNeedsXEmbed=%d\n", needsXEmbed);
#endif

        bool isOOPPlugin = aPluginInstance->GetPlugin()->GetLibrary()->IsOOP();
        if (needsXEmbed || isOOPPlugin) {        
          bool enableXtFocus = !needsXEmbed;
          rv = CreateXEmbedWindow(enableXtFocus);
        }
        else {
#if (MOZ_WIDGET_GTK == 2)
          rv = CreateXtWindow();
#else
          return NS_ERROR_FAILURE;
#endif
        }

        if (NS_FAILED(rv)) {
          return NS_ERROR_FAILURE;
        }
      }

      if (!mSocketWidget) {
        return NS_ERROR_FAILURE;
      }

      // Make sure to resize and re-place the window if required.
      SetAllocation();
      // Need to reset "window" each time as nsPluginFrame::DidReflow sets it
      // to the ancestor window.
#if (MOZ_WIDGET_GTK == 2)
      if (GTK_IS_XTBIN(mSocketWidget)) {
        // Point the NPWindow structures window to the actual X window
        SetWindow(GTK_XTBIN(mSocketWidget)->xtwindow);
      }
      else { // XEmbed or OOP&Xt
        SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
      }
#else
      // Gtk3 supports only OOP by GtkSocket
      SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
#endif

#ifdef DEBUG
      printf("nsPluginNativeWindowGtk: call SetWindow with xid=%p\n", (void *)window);
#endif
    } // NPWindowTypeWindow
    aPluginInstance->SetWindow(this);
  } else if (mPluginInstance) {
    mPluginInstance->SetWindow(nullptr);
  }

  SetPluginInstance(aPluginInstance);
  return NS_OK;
}
コード例 #2
0
ファイル: Render.cpp プロジェクト: hksonngan/invols
void Render::SetWindow(vec2 level)
{
	SetWindow(level,CT::GetCurDataID());
}
コード例 #3
0
nsresult nsPluginNativeWindowGtk::CreateXEmbedWindow(bool aEnableXtFocus) {
  NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");
  GdkDisplay *display = gdk_display_get_default();
  GdkWindow *parent_win = gdk_x11_window_lookup_for_display(display, GetWindow());
  mSocketWidget = gtk_socket_new();

  //attach the socket to the container widget
  gtk_widget_set_parent_window(mSocketWidget, parent_win);

  // enable/disable focus event handlers,
  // see plugin_window_filter_func() for details
  g_object_set_data(G_OBJECT(mSocketWidget), "enable-xt-focus", (void *)aEnableXtFocus);

  g_signal_connect(mSocketWidget, "plug_added",
                   G_CALLBACK(plug_added_cb), nullptr);

  // Make sure to handle the plug_removed signal.  If we don't the
  // socket will automatically be destroyed when the plug is
  // removed, which means we're destroying it more than once.
  // SYNTAX ERROR.
  g_signal_connect(mSocketWidget, "plug_removed",
                   G_CALLBACK(plug_removed_cb), nullptr);

  g_signal_connect(mSocketWidget, "unrealize",
                   G_CALLBACK(socket_unrealize_cb), nullptr);

  g_signal_connect(mSocketWidget, "destroy",
                   G_CALLBACK(gtk_widget_destroyed), &mSocketWidget);

  gpointer user_data = nullptr;
  gdk_window_get_user_data(parent_win, &user_data);

  GtkContainer *container = GTK_CONTAINER(user_data);
  gtk_container_add(container, mSocketWidget);
  gtk_widget_realize(mSocketWidget);

  // The GtkSocket has a visible window, but the plugin's XEmbed plug will
  // cover this window.  Normally GtkSockets let the X server paint their
  // background and this would happen immediately (before the plug is
  // created).  Setting the background to None prevents the server from
  // painting this window, avoiding flicker.
  // TODO GTK3
#if (MOZ_WIDGET_GTK == 2)
  gdk_window_set_back_pixmap(gtk_widget_get_window(mSocketWidget), nullptr, FALSE);
#endif

  // Resize before we show
  SetAllocation();

  gtk_widget_show(mSocketWidget);

  gdk_flush();
  SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));

  // Fill out the ws_info structure.
  // (The windowless case is done in nsPluginFrame.cpp.)
  GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, GetWindow());
  if(!gdkWindow)
    return NS_ERROR_FAILURE;

  mWsInfo.display = GDK_WINDOW_XDISPLAY(gdkWindow);
#if (MOZ_WIDGET_GTK == 2)
  mWsInfo.colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(gdkWindow));
  GdkVisual* gdkVisual = gdk_drawable_get_visual(gdkWindow);
  mWsInfo.depth = gdkVisual->depth;
#else
  mWsInfo.colormap = None;
  GdkVisual* gdkVisual = gdk_window_get_visual(gdkWindow);
  mWsInfo.depth = gdk_visual_get_depth(gdkVisual);
#endif
  mWsInfo.visual = GDK_VISUAL_XVISUAL(gdkVisual);
    
  return NS_OK;
}
コード例 #4
0
void ImportSampleDialog::DrawView() {

    SetWindow(LIST_WIDTH,LIST_SIZE+3) ;

    GUITextProperties props ;

// Draw title

//	char title[40] ;

    SetColor(CD_NORMAL) ;

//	sprintf(title,"Sample Import from %s",currentPath_.GetName()) ;
//	w_.DrawString(title,pos,props) ;

// Draw samples

    int x=1 ;
    int y=1 ;

    if (currentSample_<topIndex_) {
        topIndex_=currentSample_ ;
    } ;
    if (currentSample_>=topIndex_+LIST_SIZE) {
        topIndex_=currentSample_ ;
    } ;

    IteratorPtr<Path> it(sampleList_.GetIterator()) ;
    int count=0 ;
    char buffer[256] ;
    for(it->Begin(); !it->IsDone(); it->Next()) {
        if ((count>=topIndex_)&&(count<topIndex_+LIST_SIZE)) {
            Path &current=it->CurrentItem() ;
            const std::string p=current.GetName() ;

            if (count==currentSample_) {
                SetColor(CD_HILITE2) ;
                props.invert_=true ;
            } else {
                SetColor(CD_NORMAL) ;
                props.invert_=false ;
            }
            if (!current.IsDirectory()) {
                strcpy(buffer,p.c_str()) ;
            } else {
                buffer[0]='[' ;
                strcpy(buffer+1,p.c_str()) ;
                strcat(buffer,"]") ;
            }
            buffer[LIST_WIDTH-1]=0 ;
            DrawString(x,y,buffer,props) ;
            y+=1 ;
        }
        count++ ;
    } ;

    y=LIST_SIZE+2 ;
    int offset=LIST_WIDTH/4 ;

    SetColor(CD_NORMAL) ;

    for (int i=0; i<3; i++) {
        const char *text=buttonText[i] ;
        x=offset*(i+1)-strlen(text)/2 ;
        props.invert_=(i==selected_)?true:false ;
        DrawString(x,y,text,props) ;
    }
} ;
コード例 #5
0
ファイル: ArcBall.cpp プロジェクト: BillyKim/directxcode
void ArcBall::Init(float nWidth, float nHeight)
{
	SetWindow(nWidth, nHeight);
}
コード例 #6
0
void
JXChooseFileDialog::BuildWindow
	(
	const JCharacter* origName,
	const JCharacter* message
	)
{
// begin JXLayout

    JXWindow* window = new JXWindow(this, 310,340, "");
    assert( window != NULL );
    SetWindow(window);

    itsOpenButton =
        new JXTextButton(JGetString("itsOpenButton::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 219,279, 72,22);
    assert( itsOpenButton != NULL );
    itsOpenButton->SetShortcuts(JGetString("itsOpenButton::JXChooseFileDialog::shortcuts::JXLayout"));

    JXTextButton* cancelButton =
        new JXTextButton(JGetString("cancelButton::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,310, 70,20);
    assert( cancelButton != NULL );

    JXTextButton* homeButton =
        new JXTextButton(JGetString("homeButton::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 250,140, 40,20);
    assert( homeButton != NULL );

    JXStaticText* pathLabel =
        new JXStaticText(JGetString("pathLabel::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,20, 40,20);
    assert( pathLabel != NULL );

    JXScrollbarSet* scrollbarSet =
        new JXScrollbarSet(window,
                    JXWidget::kHElastic, JXWidget::kFixedBottom, 20,140, 180,190);
    assert( scrollbarSet != NULL );

    JXStaticText* filterLabel =
        new JXStaticText(JGetString("filterLabel::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,50, 40,20);
    assert( filterLabel != NULL );

    JXTextCheckbox* showHiddenCB =
        new JXTextCheckbox(JGetString("showHiddenCB::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 130,20);
    assert( showHiddenCB != NULL );

    JXPathInput* pathInput =
        new JXPathInput(window,
                    JXWidget::kHElastic, JXWidget::kFixedBottom, 60,20, 200,20);
    assert( pathInput != NULL );

    JXInputField* filterInput =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedBottom, 60,50, 200,20);
    assert( filterInput != NULL );

    JXPathHistoryMenu* pathHistory =
        new JXPathHistoryMenu(1, "", window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,20, 30,20);
    assert( pathHistory != NULL );

    JXStringHistoryMenu* filterHistory =
        new JXStringHistoryMenu(1, "", window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,50, 30,20);
    assert( filterHistory != NULL );

    JXTextButton* upButton =
        new JXTextButton(JGetString("upButton::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,140, 30,20);
    assert( upButton != NULL );

    itsSelectAllButton =
        new JXTextButton(JGetString("itsSelectAllButton::JXChooseFileDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,170, 70,20);
    assert( itsSelectAllButton != NULL );

    JXCurrentPathMenu* currPathMenu =
        new JXCurrentPathMenu("/", window,
                    JXWidget::kHElastic, JXWidget::kFixedBottom, 20,110, 180,20);
    assert( currPathMenu != NULL );

// end JXLayout

	SetObjects(scrollbarSet, pathLabel, pathInput, pathHistory,
			   filterLabel, filterInput, filterHistory,
			   itsOpenButton, cancelButton, upButton, homeButton,
			   itsSelectAllButton, showHiddenCB, currPathMenu,
			   origName, message);
}
コード例 #7
0
ファイル: EditSci.cpp プロジェクト: jaquadro/XLua
SciTECom::SciTECom (long hwnd) {
	SetWindow(hwnd);
}
コード例 #8
0
void
JXEditWWWPrefsDialog::BuildWindow
	(
	const JCharacter* showURLCmd,
	const JCharacter* showFileContentCmd,
	const JCharacter* showFileLocationCmd,
	const JCharacter* composeMailCmd
	)
{
// begin JXLayout

    JXWindow* window = new JXWindow(this, 510,290, "");
    assert( window != NULL );
    SetWindow(window);

    itsShowURLCmdInput =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 240,20, 250,20);
    assert( itsShowURLCmdInput != NULL );

    itsShowFileContentCmdInput =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 240,80, 250,20);
    assert( itsShowFileContentCmdInput != NULL );

    itsShowFileLocationCmdInput =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 240,140, 250,20);
    assert( itsShowFileLocationCmdInput != NULL );

    itsComposeMailCmdInput =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 240,200, 250,20);
    assert( itsComposeMailCmdInput != NULL );

    JXTextButton* cancelButton =
        new JXTextButton(JGetString("cancelButton::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,260, 70,20);
    assert( cancelButton != NULL );

    JXTextButton* okButton =
        new JXTextButton(JGetString("okButton::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedTop, 319,259, 72,22);
    assert( okButton != NULL );
    okButton->SetShortcuts(JGetString("okButton::JXEditWWWPrefsDialog::shortcuts::JXLayout"));

    JXStaticText* obj1_JXLayout =
        new JXStaticText(JGetString("obj1_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,40, 150,20);
    assert( obj1_JXLayout != NULL );

    JXStaticText* obj2_JXLayout =
        new JXStaticText(JGetString("obj2_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,23, 220,20);
    assert( obj2_JXLayout != NULL );

    JXStaticText* obj3_JXLayout =
        new JXStaticText(JGetString("obj3_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,203, 220,20);
    assert( obj3_JXLayout != NULL );

    JXStaticText* obj4_JXLayout =
        new JXStaticText(JGetString("obj4_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,220, 170,20);
    assert( obj4_JXLayout != NULL );

    JXStaticText* obj5_JXLayout =
        new JXStaticText(JGetString("obj5_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,100, 140,20);
    assert( obj5_JXLayout != NULL );

    JXStaticText* obj6_JXLayout =
        new JXStaticText(JGetString("obj6_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,83, 220,20);
    assert( obj6_JXLayout != NULL );

    JXStaticText* obj7_JXLayout =
        new JXStaticText(JGetString("obj7_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,160, 140,20);
    assert( obj7_JXLayout != NULL );

    JXStaticText* obj8_JXLayout =
        new JXStaticText(JGetString("obj8_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,143, 220,20);
    assert( obj8_JXLayout != NULL );

// end JXLayout

	window->SetTitle("Web Browser Preferences");
	SetButtons(okButton, cancelButton);

	itsShowURLCmdInput->SetText(showURLCmd);
	itsShowURLCmdInput->SetIsRequired();

	itsShowFileContentCmdInput->SetText(showFileContentCmd);
	itsShowFileContentCmdInput->SetIsRequired();

	itsShowFileLocationCmdInput->SetText(showFileLocationCmd);
	itsShowFileLocationCmdInput->SetIsRequired();

	itsComposeMailCmdInput->SetText(composeMailCmd);
	itsComposeMailCmdInput->SetIsRequired();
}
コード例 #9
0
ファイル: widgetOPS.c プロジェクト: authorNari/panda
static	void
UpdateWidget(WidgetData *data)
{
	GtkWidget	*widget;

	g_return_if_fail(data != NULL);
	widget = GetWidgetByLongName(data->name);
	if (widget == NULL) {
		MessagePrintf("widget [%s] is not found", data->name);
		return;
	}

	switch (data->type) {
// gtk+panda
	case WIDGET_TYPE_NUMBER_ENTRY:
		SetNumberEntry(widget, data,(_NumberEntry *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_COMBO:
		SetPandaCombo(widget, data,(_Combo *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_CLIST:
		SetPandaCList(widget, data,(_CList *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_ENTRY:
		SetEntry(widget, data,(_Entry *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TEXT:
		SetText(widget, data,(_Text *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_PREVIEW:
		SetPandaPreview(widget, data,(_PREVIEW *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TIMER:
		SetPandaTimer(widget, data,(_Timer *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_DOWNLOAD:
		SetPandaDownload(widget, data,(_Download *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_HTML:
		SetPandaHTML(widget, data,(_HTML *)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TABLE:
		SetPandaTable(widget, data,(_Table *)data->attrs);
		break;
// gtk+
	case WIDGET_TYPE_ENTRY:
		SetEntry(widget, data,(_Entry *)data->attrs);
		break;
	case WIDGET_TYPE_TEXT:
		SetText(widget, data,(_Text *)data->attrs);
		break;
	case WIDGET_TYPE_LABEL:
		SetLabel(widget, data,(_Label *)data->attrs);
		break;
	case WIDGET_TYPE_BUTTON:
	case WIDGET_TYPE_TOGGLE_BUTTON:
	case WIDGET_TYPE_CHECK_BUTTON:
	case WIDGET_TYPE_RADIO_BUTTON:
		SetButton(widget, data,(_Button *)data->attrs);
		break;
	case WIDGET_TYPE_CALENDAR:
		SetCalendar(widget, data,(_Calendar*)data->attrs);
		break;
	case WIDGET_TYPE_NOTEBOOK:
		SetNotebook(widget, data,(_Notebook*)data->attrs);
		break;
	case WIDGET_TYPE_PROGRESS_BAR:
		SetProgressBar(widget, data,(_ProgressBar*)data->attrs);
		break;
	case WIDGET_TYPE_WINDOW:
		SetWindow(widget, data,(_Window*)data->attrs);
		break;
	case WIDGET_TYPE_FRAME:
		SetFrame(widget, data,(_Frame *)data->attrs);
		break;
	case WIDGET_TYPE_SCROLLED_WINDOW:
		SetScrolledWindow(widget, data,(_ScrolledWindow *)data->attrs);
		break;
	case WIDGET_TYPE_FILE_CHOOSER_BUTTON:
		SetFileChooserButton(widget, data,(_FileChooserButton *)data->attrs);
		break;
	case WIDGET_TYPE_COLOR_BUTTON:
		SetColorButton(widget, data,(_ColorButton *)data->attrs);
		break;
// Gnome
	case WIDGET_TYPE_FILE_ENTRY:
		SetFileEntry(widget, data,(_FileEntry *)data->attrs);
		break;
	case WIDGET_TYPE_PIXMAP:
		SetPixmap(widget, data,(_Pixmap *)data->attrs);
		break;
	default:
		//MessageLogPrintf("invalid widget [%s]", data->name);
		break;
	}
}
コード例 #10
0
WindowSelectionService::WindowSelectionService(
    IWorkbenchWindow* window)
{
  SetWindow(window);
}
コード例 #11
0
void
GCLAlarmDialog::BuildWindow()
{

// begin JXLayout

    JXWindow* window = new JXWindow(this, 390,250, "");
    assert( window != NULL );
    SetWindow(window);

    itsHelpButton =
        new JXTextButton(JGetString("itsHelpButton::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 80,220, 70,20);
    assert( itsHelpButton != NULL );

    JXTextButton* okButton =
        new JXTextButton(JGetString("okButton::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 230,220, 70,20);
    assert( okButton != NULL );
    okButton->SetShortcuts(JGetString("okButton::GCLAlarmDialog::shortcuts::JXLayout"));

    itsStatusText =
        new JXStaticText(JGetString("itsStatusText::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 20,140, 350,20);
    assert( itsStatusText != NULL );
    itsStatusText->SetFontSize(14);

    itsRG =
        new JXRadioGroup(window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 20,170, 350,45);
    assert( itsRG != NULL );

    JXTextRadioButton* obj1_JXLayout =
        new JXTextRadioButton(1, JGetString("obj1_JXLayout::GCLAlarmDialog::JXLayout"), itsRG,
                    JXWidget::kHElastic, JXWidget::kVElastic, 10,0, 140,20);
    assert( obj1_JXLayout != NULL );

    JXTextRadioButton* obj2_JXLayout =
        new JXTextRadioButton(2, JGetString("obj2_JXLayout::GCLAlarmDialog::JXLayout"), itsRG,
                    JXWidget::kHElastic, JXWidget::kVElastic, 10,20, 150,20);
    assert( obj2_JXLayout != NULL );

    itsAmountInput =
        new JXIntegerInput(itsRG,
                    JXWidget::kHElastic, JXWidget::kVElastic, 160,0, 80,20);
    assert( itsAmountInput != NULL );

    itsTimeUnitMenu =
        new JXTextMenu(JGetString("itsTimeUnitMenu::GCLAlarmDialog::JXLayout"), itsRG,
                    JXWidget::kHElastic, JXWidget::kVElastic, 240,0, 100,20);
    assert( itsTimeUnitMenu != NULL );

    JXStaticText* obj3_JXLayout =
        new JXStaticText(JGetString("obj3_JXLayout::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 20,10, 350,20);
    assert( obj3_JXLayout != NULL );

    JXStaticText* obj4_JXLayout =
        new JXStaticText(JGetString("obj4_JXLayout::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 20,40, 70,20);
    assert( obj4_JXLayout != NULL );
    obj4_JXLayout->SetFontSize(14);
    const JFontStyle obj4_JXLayout_style(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetBlackColor());
    obj4_JXLayout->SetFontStyle(obj4_JXLayout_style);

    itsSubjectText =
        new JXStaticText(JGetString("itsSubjectText::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 90,40, 280,20);
    assert( itsSubjectText != NULL );
    itsSubjectText->SetFontSize(14);
    const JFontStyle itsSubjectText_style(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetBlackColor());
    itsSubjectText->SetFontStyle(itsSubjectText_style);

    JXStaticText* obj5_JXLayout =
        new JXStaticText(JGetString("obj5_JXLayout::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 20,70, 70,20);
    assert( obj5_JXLayout != NULL );
    obj5_JXLayout->SetFontSize(14);
    const JFontStyle obj5_JXLayout_style(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetBlackColor());
    obj5_JXLayout->SetFontStyle(obj5_JXLayout_style);

    itsTimeText =
        new JXStaticText(JGetString("itsTimeText::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 90,70, 280,20);
    assert( itsTimeText != NULL );
    itsTimeText->SetFontSize(14);
    const JFontStyle itsTimeText_style(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetBlackColor());
    itsTimeText->SetFontStyle(itsTimeText_style);

    itsDateText =
        new JXStaticText(JGetString("itsDateText::GCLAlarmDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 90,100, 280,20);
    assert( itsDateText != NULL );
    itsDateText->SetFontSize(14);
    const JFontStyle itsDateText_style(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetBlackColor());
    itsDateText->SetFontStyle(itsDateText_style);

// end JXLayout

	SetButtons(okButton, NULL);
	window->SetTitle("Appointment Reminder");

	itsAmountInput->SetLowerLimit(0);
	itsTimeUnitMenu->SetMenuItems(kTimeUnitMenuString);
	itsTimeUnitMenu->SetUpdateAction(JXMenu::kDisableNone);
	itsTimeUnitMenu->SetTitleText("Minute(s)");

	itsTimeUnit	= kMinute;

	ListenTo(itsTimeUnitMenu);

	itsRG->SelectItem(kRemindAgain);
	itsAmountInput->SetValue(kTimeDefault);

	BuildText();
}
コード例 #12
0
ファイル: main.cpp プロジェクト: vyrp/CCI36_Lab3
void RMouseDownZoom() {
	SetWindow(0.0f, (float)x_end, 0.0f, (float)y_end);
	ReDrawAll();
	mouse_action = NO_ACTION;
}
コード例 #13
0
ファイル: WinSystemX11.cpp プロジェクト: krattai/sht_tv
bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays)
{
  XOutput out;
  XMode mode;

  if (fullScreen)
  {
    out.name = res.strOutput;
    mode.w   = res.iWidth;
    mode.h   = res.iHeight;
    mode.hz  = res.fRefreshRate;
    mode.id  = res.strId;
  }
  else
  {
    out.name = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).strOutput;
    mode.w   = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).iWidth;
    mode.h   = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).iHeight;
    mode.hz  = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).fRefreshRate;
    mode.id  = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).strId;
  }
 
  XMode   currmode = g_xrandr.GetCurrentMode(out.name);
  if (!currmode.name.empty())
  {
    // flip h/w when rotated
    if (m_bIsRotated)
    {
      int w = mode.w;
      mode.w = mode.h;
      mode.h = w;
    }

    // only call xrandr if mode changes
    if (m_mainWindow)
    {
      if (currmode.w != mode.w || currmode.h != mode.h ||
          currmode.hz != mode.hz || currmode.id != mode.id)
      {
        CLog::Log(LOGNOTICE, "CWinSystemX11::SetFullScreen - calling xrandr");

        // remember last position of mouse
        Window root_return, child_return;
        int root_x_return, root_y_return;
        int win_x_return, win_y_return;
        unsigned int mask_return;
        bool isInWin = XQueryPointer(m_dpy, m_mainWindow, &root_return, &child_return,
                                     &root_x_return, &root_y_return,
                                     &win_x_return, &win_y_return,
                                     &mask_return);

        if (isInWin)
        {
          m_MouseX = win_x_return;
          m_MouseY = win_y_return;
        }
        else
        {
          m_MouseX = -1;
          m_MouseY = -1;
        }

        OnLostDevice();
        m_bIsInternalXrr = true;
        g_xrandr.SetMode(out, mode);
        return true;
      }
    }
  }

  if (!SetWindow(res.iWidth, res.iHeight, fullScreen, m_userOutput))
    return false;

  m_nWidth      = res.iWidth;
  m_nHeight     = res.iHeight;
  m_bFullScreen = fullScreen;
  m_currentOutput = m_userOutput;

  return true;
}
コード例 #14
0
ファイル: Camera.cpp プロジェクト: dreamsxin/nsg-library
 void Camera::UnRegisterWindow()
 {
     slotWindow_ = nullptr;
     SetWindow(nullptr);
 }
コード例 #15
0
ファイル: TaskbarButton.cpp プロジェクト: plague85/qwin7utils
 TaskbarButton::TaskbarButton(QWidget* parent) : QObject(parent) {
     SetWindow(parent);
 }
コード例 #16
0
// Função Main
int main()
{
	// Redimensionando a Janela
	SetWindow(800,600); // Console.h

	// Declaração de Variaveis
    int opcao=0;
	char grid[41][41];
	struct TVPontos pontos;
	struct TVLinhas linhas;
	struct TVTriangulos triangulos;
	struct TVRetangulos retangulos;
	
    // While para o Menu
    while (opcao!=9)
	{
        system("cls");
        AtualizaGrafico(grid,pontos,linhas,triangulos,retangulos); // GeoLib.h	
        opcao=Menu(); // Console.h	
        system ("cls");
        switch (opcao) // Tratamento da Opção Escolhida
		{
            case 1: // Incluir Ponto
				{
					iPonto(pontos); // Console.h
					break;
                }
            case 2: // Excluir Ponto
				{
					ePonto(pontos); // Console.h
                    break;
                }
            case 3: // Incluir Linha
				{
					iLinha(linhas); // Console.h
                    break;
                }
            case 4: // Excluir Linha
				{
					eLinha(linhas); // Console.h
                    break;
                }
            case 5: // Incluir Triangulo
				{
					iTriangulo(triangulos); // Console.h
                    break;
                }
            case 6: // Excluir Triangulo
				{
					eTriangulo(triangulos); // Console.h
                    break;
                }
            case 7: // Incluir Retangulo
				{
					iRetangulo(retangulos); // Console.h
                    break;
                }
            case 8: // Excluir Retangulo
				{	
					eRetangulo(retangulos); // Console.h
                    break;
                }				
        }
    }
	// Impressões finais
	printf("\nFim do Programa!\n\n");
	system("PAUSE");
	return 0;
}