ShowTabWorkSpace is NULL
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6343
Printed Date: 15 November 2024 at 10:59pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: ShowTabWorkSpace is NULL
Posted By: mav50202
Subject: ShowTabWorkSpace is NULL
Date Posted: 07 February 2007 at 1:40pm
Hi, friends.
I have a problem with this code in Visual Foxpro 9 SP1
workspace = CommandBars.ShowTabWorkspace(.t.) workspace.EnableGroups()
When i execute this code, WorkSpace not is a object else is NULL, then i dont access to the properties and methods of TabWorkSpace.
I need your help.
Thank very much for all.
|
Replies:
Posted By: Oleg
Date Posted: 07 February 2007 at 3:12pm
Hi,
CommandBars can't find MDI client in foxPro window.
Set it using SetMDIClient method.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: mav50202
Date Posted: 08 February 2007 at 10:25am
Ok, but i need your help again, i dont know what is the form wich set it in setclient method: The main form the child form or forms
Have i set it setclient only one time for the main form??? or for every child form??
And in adittion i have other problem with the child forms, the child form is over the toolbar and not respect this area.
Example:
|
Posted By: Oleg
Date Posted: 08 February 2007 at 11:41am
Hi,
Actually we never tested it in FoxPro and never write that CommandBars support it. Attach this sample, I will debug it.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: mav50202
Date Posted: 08 February 2007 at 12:25pm
Thank very much for your help , here is the sample.
INIT METHOD (MAIN FORM)
PUBLIC commandbars
commandbars = thisform.commandBars
thisform.createribbonbar()
local StatusBar As XtremeCommandBars.StatusBar StatusBar = this.CommandBars.StatusBar StatusBar.Visible = .t.
StatusBar.AddPane(0) oPane = StatusBar.AddPane(1) oPane.width = 70 oPane = StatusBar.AddPane(2) oPane.width = 50 StatusBar.AddPane(ID_INDICATOR_CAPS) StatusBar.AddPane(ID_INDICATOR_NUM) StatusBar.AddPane(ID_INDICATOR_SCRL)
RibbonBar.EnableFrameTheme()
CommandBars.Options.KeyboardCuesShow = 2
CommandBars.setmdIClient(thisform.hWnd)
CommandBars.EnableCustomization(.t.)
public Workspace As CommandBars.TabWorkspace
tabworkspace = commandbars.showTabWorkspace(.t.) tabworkspace.EnableGroups()
CREATERIBBONBAR METHOD
PUBLIC RibbonBar As XtremeCommandBars.RibbonBar RibbonBar = CommandBars.AddRibbonBar("The Ribbon") RibbonBar.EnableDocking(1048576) RibbonBar.Minimized = .t.
local ControlAbout As XtremeCommandBars.CommandBarControl
ControlFile = RibbonBar.AddSystemButton() ControlFile.IconId = ID_SYSTEM_ICON ControlFile.CommandBar.Controls.Add(1, ID_FILE_NEW, "&New", .f., .f.) ControlFile.CommandBar.Controls.Add(1, ID_FILE_OPEN, "&Open...", .f., .f.) oControl = ControlFile.CommandBar.Controls.Add(1, ID_FILE_PRINT_SETUP, "Pr&int Setup...", .f., .f.) oControl.BeginGroup = .t. oControl = ControlFile.CommandBar.Controls.Add(1, ID_FILE_MRU_FILE1, "Recent File", .f., .f.) oControl.BeginGroup = .t. oControl.Enabled = .f. oControl = ControlFile.CommandBar.Controls.Add(1, ID_APP_EXIT, "E&xit", .f., .f.) oControl.BeginGroup = .t. ControlFile.CommandBar.SetIconSize(32, 32)
ControlAbout = RibbonBar.Controls.Add(1, ID_APP_ABOUT, "&About", .f., .f.) ControlAbout.Flags =1
TabHome = RibbonBar.InsertTab(0, "&Home") TabHome.Id = ID_TAB_HOME
GroupFile = TabHome.Groups.AddGroup("File", ID_GROUP_FILE) GroupFile.Add(1, ID_FILE_NEW, "&New", .f., .f.) GroupFile.Add(1, ID_FILE_OPEN, "&Open", .f., .f.) GroupFile.Add(1, ID_FILE_CLOSE, "&Close", .f., .f.) ControlSaveAs = GroupFile.Add(4, ID_FILE_SAVE, "&Save", .f., .f.) ControlSaveAs.CommandBar.Controls.Add(1, ID_FILE_SAVE, "&Save", .f., .f.) ControlSaveAs.CommandBar.Controls.Add(1, ID_FILE_SAVE_AS, "Save &As...", .f., .f.) ControlPrint = GroupFile.Add(4, ID_FILE_PRINT, "Print", .f., .f.) ControlPrint.CommandBar.Controls.Add(1, ID_FILE_PRINT, "&Print", .f., .f.) ControlPrint.CommandBar.Controls.Add(1, ID_FILE_PRINT_SETUP, "Print &Setup...", .f., .f.) ControlPrint.BeginGroup = .t.
[....] And the rest code for menus.
COMMANDBARS.EXECUTE METHOD
LPARAMETERS control
DO case
Case control.id = 57648 thisform.LoadNewDoc()
ENDCASE
LOADNEWDOC METHOD
DO FORM c:\frmdocument noshow
CommandBars.EnableOffice2007FrameHandle( frmdocument.hwnd )
frmdocument.show()
|
Posted By: mav50202
Date Posted: 13 February 2007 at 5:19am
At least, i did it, the only way is put the commanbar control in a toolbar of Visual Foxpro, with that way you will get that the windows is not over the commandbar.
Is important set the property setminimumwidth.
Thank you for all.
|
Posted By: Oleg
Date Posted: 13 February 2007 at 7:56am
Hi,
Glad you find it.
Sorry I didn't see you added post with code.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: vicos
Date Posted: 01 February 2013 at 2:48pm
Share your example with community please...
|
|