• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetWidget函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetWidget函数的典型用法代码示例。如果您正苦于以下问题:C++ GetWidget函数的具体用法?C++ GetWidget怎么用?C++ GetWidget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: g_static_mutex_lock

void *OpenURL(char *url)
{
	DWORD c,r;
	g_static_mutex_lock(&lock); // make sure only 1 thread at a time can do the following
	r=++req; // increment the request counter for this request
	g_static_mutex_unlock(&lock);
	if (prebuftimer) {
		g_source_remove(prebuftimer); // stop prebuffer monitoring
		prebuftimer=0;
	}
	BASS_StreamFree(chan); // close old stream
	gdk_threads_enter();
	gtk_label_set_text(GTK_LABEL(GetWidget("status1")),"");
	gtk_label_set_text(GTK_LABEL(GetWidget("status2")),"connecting...");
	gtk_label_set_text(GTK_LABEL(GetWidget("status3")),"");
	gdk_threads_leave();
	c=BASS_StreamCreateURL(url,0,BASS_STREAM_BLOCK|BASS_STREAM_STATUS|BASS_STREAM_AUTOFREE,StatusProc,0);
	free(url); // free temp URL buffer
	g_static_mutex_lock(&lock);
	if (r!=req) { // there is a newer request, discard this stream
		g_static_mutex_unlock(&lock);
		if (c) BASS_StreamFree(c);
		return NULL;
	}
	chan=c; // this is now the current stream
	g_static_mutex_unlock(&lock);
	if (!chan) {
		gdk_threads_enter();
		gtk_label_set_text(GTK_LABEL(GetWidget("status2")),"not playing");
		Error("Can't play the stream");
		gdk_threads_leave();
	} else
		prebuftimer=g_timeout_add(50,PrebufTimerProc,NULL); // start prebuffer monitoring
	return NULL;
}
开发者ID:adius,项目名称:FeetJ,代码行数:35,代码来源:netradio.c


示例2: ToComboBox

void CFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded,
                                       uint32_t dwStylesExRemoved) {
  if (GetWidget()) {
    ToComboBox(GetWidget())
        ->EditModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
  }
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:7,代码来源:cfwl_combobox.cpp


示例3: SwapClicked

void SwapClicked(GtkButton *obj, gpointer data)
{
	const gchar *objname=gtk_widget_get_name(GTK_WIDGET(obj));
	int speaker=atoi(objname+4)-1; // get speaker pair number from button name ("swapX")
	{ // swap handles
		HSTREAM temp=chan[speaker];
		chan[speaker]=chan[speaker+1];
		chan[speaker+1]=temp;
	}
	{ // swap text
		GtkButton *open1,*open2;
		char bname[10],*temp;
		sprintf(bname,"open%d",1+speaker);
		open1=GTK_BUTTON(GetWidget(bname));
		sprintf(bname,"open%d",1+speaker+1);
		open2=GTK_BUTTON(GetWidget(bname));
		temp=strdup(gtk_button_get_label(open1));
		gtk_button_set_label(open1,gtk_button_get_label(open2));
		gtk_button_set_label(open2,temp);
		free(temp);
	}
	// update the channel devices
	BASS_ChannelFlags(chan[speaker],flags[speaker],BASS_SPEAKER_FRONT);
	BASS_ChannelFlags(chan[speaker+1],flags[speaker+1],BASS_SPEAKER_FRONT);
}
开发者ID:AntonGerasimov,项目名称:Converter,代码行数:25,代码来源:speakers.c


示例4: GetWidget

    void DialogClientView::PaintSizeBox(gfx::Canvas* canvas)
    {
        if(GetWidget()->widget_delegate()->CanResize() ||
            GetWidget()->widget_delegate()->CanMaximize())
        {
            gfx::NativeTheme::ExtraParams extra;
            gfx::Size gripper_size = gfx::NativeTheme::instance()->GetPartSize(
                gfx::NativeTheme::kWindowResizeGripper, gfx::NativeTheme::kNormal,
                extra);

            // TODO(beng): (http://b/1085509) In "classic" rendering mode, there isn't
            //             a theme-supplied gripper. We should probably improvise
            //             something, which would also require changing |gripper_size|
            //             to have different default values, too...
            size_box_bounds_ = GetContentsBounds();
            size_box_bounds_.set_x(size_box_bounds_.right() - gripper_size.width());
            size_box_bounds_.set_y(size_box_bounds_.bottom() - gripper_size.height());

            gfx::NativeTheme::instance()->Paint(canvas->AsCanvasSkia(),
                gfx::NativeTheme::kWindowResizeGripper,
                gfx::NativeTheme::kNormal,
                size_box_bounds_,
                extra);
        }
    }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:25,代码来源:dialog_client_view.cpp


示例5: PrebufTimerProc

gboolean PrebufTimerProc(gpointer data)
{ // monitor prebuffering progress
	DWORD progress=BASS_StreamGetFilePosition(chan,BASS_FILEPOS_BUFFER)
		*100/BASS_StreamGetFilePosition(chan,BASS_FILEPOS_END); // percentage of buffer filled
	if (progress>75 || !BASS_StreamGetFilePosition(chan,BASS_FILEPOS_CONNECTED)) { // over 75% full (or end of download)
		{ // get the broadcast name and URL
			const char *icy=BASS_ChannelGetTags(chan,BASS_TAG_ICY);
			if (!icy) icy=BASS_ChannelGetTags(chan,BASS_TAG_HTTP); // no ICY tags, try HTTP
			if (icy) {
				for (;*icy;icy+=strlen(icy)+1) {
					if (!strncasecmp(icy,"icy-name:",9))
						gtk_label_set_text_8859(GTK_LABEL(GetWidget("status2")),icy+9);
					if (!strncasecmp(icy,"icy-url:",8))
						gtk_label_set_text_8859(GTK_LABEL(GetWidget("status3")),icy+8);
				}
			} else
				gtk_label_set_text(GTK_LABEL(GetWidget("status2")),"");
		}
		// get the stream title and set sync for subsequent titles
		DoMeta();
		BASS_ChannelSetSync(chan,BASS_SYNC_META,0,&MetaSync,0); // Shoutcast
		BASS_ChannelSetSync(chan,BASS_SYNC_OGG_CHANGE,0,&MetaSync,0); // Icecast/OGG
		// set sync for end of stream
		BASS_ChannelSetSync(chan,BASS_SYNC_END,0,&EndSync,0);
		// play it!
		BASS_ChannelPlay(chan,FALSE);
		return FALSE; // stop monitoring
	} else {
		char text[20];
		sprintf(text,"buffering... %d%%",progress);
		gtk_label_set_text(GTK_LABEL(GetWidget("status2")),text);
		return TRUE; // continue monitoring
	}
}
开发者ID:adius,项目名称:FeetJ,代码行数:34,代码来源:netradio.c


示例6: OpenClicked

void OpenClicked(GtkButton *obj, gpointer data)
{
	int resp=gtk_dialog_run(GTK_DIALOG(filesel));
	gtk_widget_hide(filesel);
	if (resp==GTK_RESPONSE_ACCEPT) {
		char *file=gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel));
		// free both MOD and stream, it must be one of them! :)
		BASS_MusicFree(chan);
		BASS_StreamFree(chan);
		if (!(chan=BASS_StreamCreateFile(FALSE,file,0,0,BASS_SAMPLE_LOOP|BASS_SAMPLE_FLOAT))
			&& !(chan=BASS_MusicLoad(FALSE,file,0,0,BASS_MUSIC_RAMPS|BASS_SAMPLE_LOOP|BASS_SAMPLE_FLOAT,1))) {
			// whatever it is, it ain't playable
			gtk_button_set_label(obj,"click here to open a file...");
			Error("Can't play the file");
		} else {
			BASS_CHANNELINFO info;
			BASS_ChannelGetInfo(chan,&info);
			if (info.chans!=2) { // the DSP expects stereo
				gtk_button_set_label(obj,"click here to open a file...");
				BASS_MusicFree(chan);
				BASS_StreamFree(chan);
				Error("only stereo sources are supported");
			} else {
				gtk_button_set_label(obj,file);
				// setup DSPs on new channel and play it
				RotateToggled(GTK_TOGGLE_BUTTON(GetWidget("rotate")),0);
				EchoToggled(GTK_TOGGLE_BUTTON(GetWidget("echo")),0);
				FlangerToggled(GTK_TOGGLE_BUTTON(GetWidget("flanger")),0);
				BASS_ChannelPlay(chan,FALSE);
			}
		}
		g_free(file);
	}
}
开发者ID:AntonGerasimov,项目名称:Converter,代码行数:34,代码来源:dsptest.c


示例7: Create

void SurfaceDlg::ShowDlg(){
	Dialog::ShowDlg();
	if ( GetWidget() == NULL ) {
		Create();
	}
	g_surfwin = GetWidget();
}
开发者ID:Barbatos,项目名称:GtkRadiant,代码行数:7,代码来源:surfacedialog.cpp


示例8: GetWidget

void OpPersonalbar::OnTreeChanged(OpTreeModel* tree_model)
{
    if( tree_model == g_hotlist_manager->GetBookmarksModel() )
    {
        for( INT32 i=GetWidgetCount()-1; i>=0; i-- )
        {
            OpWidget* widget = GetWidget(i);
            if( widget && widget->GetType() != WIDGET_TYPE_SEARCH_EDIT )
            {
                RemoveWidget(i);
            }
        }
    }
#ifdef DESKTOP_UTIL_SEARCH_ENGINES
    else if( tree_model == g_searchEngineManager )
    {
        for( INT32 i=GetWidgetCount()-1; i>=0; i-- )
        {
            OpWidget* widget = GetWidget(i);
            if( widget && widget->GetType() == WIDGET_TYPE_SEARCH_EDIT )
            {
                RemoveWidget(i);
            }
        }
    }
#endif // DESKTOP_UTIL_SEARCH_ENGINES

    for (INT32 i = 0; i < tree_model->GetItemCount(); i++)
    {
        AddItem(tree_model, i, TRUE);
    }
}
开发者ID:prestocore,项目名称:browser,代码行数:32,代码来源:OpPersonalbar.cpp


示例9: PaintChildren

 void DialogClientView::PaintChildren(gfx::Canvas* canvas)
 {
     View::PaintChildren(canvas);
     if(!GetWidget()->IsMaximized() && !GetWidget()->IsMinimized())
     {
         PaintSizeBox(canvas);
     }
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:8,代码来源:dialog_client_view.cpp


示例10: EndSync

void CALLBACK EndSync(HSYNC handle, DWORD channel, DWORD data, void *user)
{
	gdk_threads_enter();
	gtk_label_set_text(GTK_LABEL(GetWidget("status1")),"");
	gtk_label_set_text(GTK_LABEL(GetWidget("status2")),"not playing");
	gtk_label_set_text(GTK_LABEL(GetWidget("status3")),"");
	gdk_threads_leave();
}
开发者ID:adius,项目名称:FeetJ,代码行数:8,代码来源:netradio.c


示例11: GetWidget

Layout* LayoutItem::ParentLayout() const {
    if(GetWidget()) {
        return GetWidget()->ParentLayout();
    } else if(GetLayout()) {
        GetLayout()->ParentLayout();
    }
    return nullptr;
}
开发者ID:koalamrfan,项目名称:koala,代码行数:8,代码来源:layout_item.cpp


示例12: GetWidget

    // Overridden from AxHostDelegate:
    HWND FlashView::GetAxHostWindow() const
    {
        if(!GetWidget())
        {
            return NULL;
        }

        return GetWidget()->GetNativeView();
    }
开发者ID:Beifeng,项目名称:WTL-DUI,代码行数:10,代码来源:flash_view.cpp


示例13: GetWidget

	void PuttyView::OnFocus()
	{
		::SetFocus(puttyController_->getNativePage());
        if(GetWidget())
        {
            GetWidget()->NotifyAccessibilityEvent(
                this, ui::AccessibilityTypes::EVENT_FOCUS, false);
        }
	}
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:9,代码来源:putty_view.cpp


示例14: GetWidget

    // Overridden from AxHostDelegate:
    HWND SilverlightView::GetAxHostWindow() const
    {
        if(!GetWidget())
        {
            return NULL;
        }

        return GetWidget()->GetNativeView();
    }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:10,代码来源:silverlight_view.cpp


示例15: GetWidget

    // Overridden from AxHostDelegate:
    HWND MediaPlayerView::GetAxHostWindow() const
    {
        if(!GetWidget())
        {
            return NULL;
        }

        return GetWidget()->GetNativeView();
    }
开发者ID:JoKaWare,项目名称:GWidget,代码行数:10,代码来源:mediaplay_view.cpp


示例16: GetWidget

    // Overridden from AxHostDelegate:
    HWND WebBrowserView::GetAxHostWindow() const
    {
        if(!GetWidget())
        {
            return NULL;
        }

        return GetWidget()->GetNativeView();
    }
开发者ID:JoKaWare,项目名称:GWidget,代码行数:10,代码来源:webbrowser_view.cpp


示例17: GetWidget

void
CConsoleForm::OnPostLayoutLoad( void )
{GUCE_TRACE;

    CFormEx::OnPostLayoutLoad();
    
    m_inputEditbox = static_cast< GUCEF::GUI::CEditbox* >( GetWidget( "InputEditbox" ) );
    m_consoleTextbox = static_cast< GUCEF::GUI::CTextbox* >( GetWidget( "ConsoleTextbox" ) );
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:9,代码来源:guceGUI_CConsoleForm.cpp


示例18: IsEmpty

bool LayoutItem::IsEmpty() const {
    if(GetWidget() && GetWidget()->IsVisible()) {
        return false;
    } else if(GetLayout() && !GetLayout()->IsEmpty()) {
        return false;
    } else if(GetLayoutSpace()) {
        return false;
    }
    return true;
}
开发者ID:koalamrfan,项目名称:koala,代码行数:10,代码来源:layout_item.cpp


示例19: PreCreation

// Create menubar
bool wxMenuBar::CreateMenuBar(wxFrame* parent)
{
    m_parent = parent; // bleach... override it!
    PreCreation();
    m_parent = NULL;

    if (m_mainWidget)
    {
        XtVaSetValues((Widget) parent->GetMainWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
        /*
        if (!XtIsManaged((Widget) m_mainWidget))
        XtManageChild((Widget) m_mainWidget);
        */
        XtMapWidget((Widget) m_mainWidget);
        return true;
    }

    Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(),
                                       wxMOTIF_STR("MenuBar"), NULL, 0);
    m_mainWidget = (WXWidget) menuBarW;

    size_t menuCount = GetMenuCount();
    for (size_t i = 0; i < menuCount; i++)
    {
        wxMenu *menu = GetMenu(i);
        wxString title(m_titles[i]);
        menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, i, title, true));

        if (strcmp (wxStripMenuCodes(title), "Help") == 0)
            XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);

        // tear off menu support
#if (XmVersion >= 1002)
        if ( menu->IsTearOff() )
        {
            XtVaSetValues(GetWidget(menu),
                          XmNtearOffModel, XmTEAR_OFF_ENABLED,
                          NULL);
            Widget tearOff = XmGetTearOffControl(GetWidget(menu));
            wxDoChangeForegroundColour((Widget) tearOff, m_foregroundColour);
            wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, true);
        }
#endif
    }

    PostCreation();

    XtVaSetValues((Widget) parent->GetMainWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
    XtRealizeWidget ((Widget) menuBarW);
    XtManageChild ((Widget) menuBarW);
    SetMenuBarFrame(parent);

    return true;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:55,代码来源:menu.cpp


示例20: NS_ENSURE_ARG_POINTER

nsresult
nsIMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
                                 nsIContent* aContent)
{
  NS_ENSURE_ARG_POINTER(aPresContext);

  nsCOMPtr<nsIWidget> widget = GetWidget(aPresContext);
  if (!widget) {
    return NS_OK;
  }

  PRUint32 newState = GetNewIMEState(aPresContext, aContent);
  if (aPresContext == sPresContext && aContent == sContent) {
    // actual focus isn't changing, but if IME enabled state is changing,
    // we should do it.
    PRUint32 newEnabledState = newState & nsIContent::IME_STATUS_MASK_ENABLED;
    if (newEnabledState == 0) {
      // the enabled state isn't changing, we should do nothing.
      return NS_OK;
    }
    PRUint32 enabled;
    if (NS_FAILED(widget->GetIMEEnabled(&enabled))) {
      // this platform doesn't support IME controlling
      return NS_OK;
    }
    if (enabled ==
        nsContentUtils::GetWidgetStatusFromIMEStatus(newEnabledState)) {
      // the enabled state isn't changing.
      return NS_OK;
    }
  }

  // Current IME transaction should commit
  if (sPresContext) {
    nsCOMPtr<nsIWidget> oldWidget;
    if (sPresContext == aPresContext)
      oldWidget = widget;
    else
      oldWidget = GetWidget(sPresContext);
    if (oldWidget)
      oldWidget->ResetInputState();
  }

  if (newState != nsIContent::IME_STATUS_NONE) {
    // Update IME state for new focus widget
    SetIMEState(newState, widget);
  }

  sPresContext = aPresContext;
  sContent = aContent;

  return NS_OK;
}
开发者ID:PolyMtl,项目名称:crash-inducing,代码行数:53,代码来源:007fcabab709604df64a3d466095030f07001027.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetWidth函数代码示例发布时间:2022-05-30
下一篇:
C++ GetWeaponForAttack函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap