1.请教一下extjs中如何把Ext.PagingToolbar的分页按钮和显示信息交换位置,本来是分页按钮在左边
2.vb中Toolbar1.Buttons(n),n与菜单中的pygame源码菜单项如何对应的,依次数个数,还是虚拟商品app源码
请教一下extjs中如何把Ext.PagingToolbar的分页按钮和显示信息交换位置,本来是流量交换联盟源码分页按钮在左边
源码里面写死了。要是需要的话,可以参照源码,把后面显示的displayMsg写到前面就好了。附源码:
initComponent : function(){var pagingItems = [this.first = new T.Button({
tooltip: this.firstText,
overflowText: this.firstText,
iconCls: 'x-tbar-page-first',
disabled: true,
handler: this.moveFirst,
scope: this
}), this.prev = new T.Button({
tooltip: this.prevText,
overflowText: this.prevText,
iconCls: 'x-tbar-page-prev',
disabled: true,
handler: this.movePrevious,
scope: this
}), '-', this.beforePageText,
this.inputItem = new Ext.form.NumberField({
cls: 'x-tbar-page-number',
allowDecimals: false,
allowNegative: false,
enableKeyEvents: true,
selectOnFocus: true,
submitValue: false,
listeners: {
scope: this,
keydown: this.onPagingKeyDown,
blur: this.onPagingBlur
}
}), this.afterTextItem = new T.TextItem({
text: String.format(this.afterPageText, 1)
}), '-', this.next = new T.Button({
tooltip: this.nextText,
overflowText: this.nextText,
iconCls: 'x-tbar-page-next',
disabled: true,
handler: this.moveNext,
scope: this
}), this.last = new T.Button({
tooltip: this.lastText,
overflowText: this.lastText,
iconCls: 'x-tbar-page-last',
disabled: true,
handler: this.moveLast,
scope: this
}), '-', this.refresh = new T.Button({
tooltip: this.refreshText,
overflowText: this.refreshText,
iconCls: 'x-tbar-loading',
handler: this.doRefresh,
scope: this
})];
var userItems = this.items || this.buttons || [];
if (this.prependButtons) {
this.items = userItems.concat(pagingItems);
}else{
this.items = pagingItems.concat(userItems);
}
delete this.buttons;
if(this.displayInfo){
this.items.push('->');
this.items.push(this.displayItem = new T.TextItem({ }));
}
Ext.PagingToolbar.superclass.initComponent.call(this);
vb中Toolbar1.Buttons(n),n与菜单中的菜单项如何对应的,依次数个数,还是天猫果园源码
看下面的示例,你最好是给关键字,因为关键字易懂
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "View" '浏览
Set TabStrip1.SelectedItem = TabStrip1.Tabs(2)
Case "Add" '添加
frmAddArticle.Show 1, Me
Case "Open" '打开
mnuOperate_Open_Click
Case "del"
mnuOperate_Del_Click
Case "Compact" '压缩
Call frmSetting.cmdCompact_Click
Case "Backup" '备份"
Call frmSetting.cmdBackup_Click
Case "Recover" '恢复
Call mnuChoice_Recover_Click
Case "Setting" '设置
frmSetting.Show 1, Me
Case "Font" '字体
mnuOperate_Font_Click
Case "Exit" '退出
End
End Select
End Sub
如果是按钮菜单,这样来做:(判断的论据是菜单项的文本内容,也可以是其他的)
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Select Case ButtonMenu
Case "添加文章"
Load frmAddArticle
frmAddArticle.Show 1, Me
Case "添加源代码"
frmAddCode.Show 1, Me
Case "浏览文章"
Set TabStrip1.SelectedItem = TabStrip1.Tabs(2)
Case "浏览源代码"
Set TabStrip1.SelectedItem = TabStrip1.Tabs(1)
End Select
End Sub