Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
Created November 21, 2012 17:15
Show Gist options
  • Select an option

  • Save DinisCruz/4126139 to your computer and use it in GitHub Desktop.

Select an option

Save DinisCruz/4126139 to your computer and use it in GitHub Desktop.
O2 Script - Create ToolStrips items (buttons, textbox, checkboxes) with icons
var visualStudio = new VisualStudio_2010();
var topPanel = "topPanel".o2Cache<Panel>(false,()=> visualStudio.open_Panel())
.add_Panel(true);
var toolStrip = topPanel.insert_Above_ToolStrip();
toolStrip.beginUpdate()
.add_New(()=>{})
.add_Open(()=>{})
.add_Save(()=>{})
.add_Play(()=>{})
.add_Stop(()=>{})
.add_Cut (()=>{})
.add_Refresh(()=>{})
.endUpdate();
topPanel.insert_Below_ToolStrip()
.add("Another Play", "btExecuteSelectedMethod_Image".formImage(), ()=>{})
.add("Folder",FormImages.folder, ()=>{})
.add(FormImages.face_smile, ()=>{})
.add_Text("some text")
.add_TextBox("1234a", (text)=> text.info())
.add_CheckBox("check me", (value)=>{})
.add_DropDown("a menu")
.add_DropDown_Button("test 1", FormImages.face_smile, ()=> "hello 2".alert())
.add_DropDown_Button("test 2", FormImages.face_smile, ()=> "hello 2".alert());
topPanel.insert_Left_ToolStrip()
.add(FormImages.face_smile, ()=>{})
.add(FormImages.face_grin, ()=>{})
.add(FormImages.face_wink, ()=>{});
topPanel.insert_Right_ToolStrip()
.add(FormImages.go_next, ()=>{})
.add(FormImages.go_previous, ()=>{})
.add(FormImages.go_up, ()=>{})
.add(FormImages.go_down, ()=>{})
.add(FormImages.go_jump, ()=>{})
.add(FormImages.go_bottom, ()=>{});
return topPanel;
//using O2.Platform.BCL.O2_Views_ASCX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment