Print Page | Close Window

Custom tear off popup

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=8831
Printed Date: 18 June 2025 at 2:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom tear off popup
Posted By: SReedie
Subject: Custom tear off popup
Date Posted: 19 November 2007 at 7:46am
I have a picture box with some of your slider controls on. I add a popup control and in the InitCommandsPopup event I add this code from your DynamicPopups example:
 
If CommandBar.Title = "3D Chart" Then

        Dim ControlForm As XtremeCommandBars.CommandBarControlCustom
       
        CommandBar.Controls.DeleteAll
        Set ControlForm = CommandBar.Controls.Add(xtpControlCustom, ID_EPOS_CHT_PROPS_3D_CHART_POPUP, "3D Chart")
        ControlForm.Handle = pic3D.hWnd
        CommandBar.SetTearOffPopup "3D Chart", ID_EPOS_CHT_PROPS_3D_CHART, 200

End If
 
the popup displays with the picturebox attached and it can be 'torn off'. The problem is that when I close the floating popup and then redisplay it the picturebox is no longer attached to the popup just a normal command button with the caption 3D Chart. WHat is happening to the picturebox when I close the floating popup?
 
Reedie.



Replies:
Posted By: Oleg
Date Posted: 19 November 2007 at 8:49am
Hi,
CustomControls can't be placed to TearOff popup.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: SReedie
Date Posted: 20 November 2007 at 7:04am
Hi Oleg,
 
I was using a picturebox because I wanted to place slider controls on the toolbar (using your slider control not windows). If I try this:
 
If CommandBar.Title = "3D Chart" Then
        CommandBar.Controls.DeleteAll
        AddButton CommandBar.Controls, xtpControlCustom, ID_EPOS_CHT_PROPS_3D_CHART_POPUP_ELEVATION
        CommandBar.Controls(1).Caption = "&Elevation"
        CommandBar.Controls(1).DescriptionText = "Change the chart elevation"
        CommandBar.Controls(1).ToolTipText = "Elevation"
        CommandBar.Controls(1).Handle = Slider.hWnd
    End If
 
the slider is displayed but it covers the whole commandbar:
 
 
and when I click on it the control is disappearing from the commandbar and becoming visible wherever the control was put on the form at design time:
 
 
Is there any way to attach a slide control to a commandbar and have the caption display as well without it disappearing on a click?
 
Thanks for your help,

Reedie


Posted By: Oleg
Date Posted: 20 November 2007 at 7:10am
Hi,
 
To fix disappearing please put Slider to picturebox and attach picturebox .
 
actually in 11.2.1 release was added builtin slider for CommandBars.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: SReedie
Date Posted: 20 November 2007 at 8:22am
Hi Oleg,
 
So I have got the newest release and I now have my code like this:
 
If CommandBar.Title = "3D Chart" Then
        Dim ControlSlider As XtremeCommandBars.CommandBarSlider
       
        CommandBar.Controls.DeleteAll
        Set ControlSlider = CommandBar.Controls.Add(xtpControlCustom, ID_EPOS_CHT_PROPS_3D_CHART_POPUP, "3D Chart")
    End If
 
but I am getting a type mismatch error presumably from the control type xtpControlCustom but there is no slider control type (xtpControlSlider) when the enumeration list is displayed after .Add(.
 
Am I missing something?
 
Reedie.


Posted By: Oleg
Date Posted: 20 November 2007 at 1:59pm
Hi,
 
Try this code.
 
    Dim ControlSlider As XtremeCommandBars.CommandBarSlider
    Set ControlSlider = CommandBars.CreateCommandBarControl("CXTPControlSlider")
    ControlFile.CommandBar.Controls.AddControl ControlSlider


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: SReedie
Date Posted: 21 November 2007 at 3:52am
Hi Oleg,
 
Excellent, thank you this code works:
 
If CommandBar.Title = "3D Chart" Then
        Dim ControlSlider As XtremeCommandBars.CommandBarSlider
        CommandBar.Controls.DeleteAll
        Set ControlSlider = CommandBars.CreateCommandBarControl("CXTPControlSlider")
        CommandBar.Controls.AddControl ControlSlider
        CommandBar.Controls(1).Caption = "&Elevation"
        CommandBar.Controls(1).DescriptionText = "Set the chart elevation level"
        CommandBar.Controls(1).Style = xtpButtonIcon
        CommandBar.Controls(1).ToolTipText = "Elevation"
        CommandBar.SetTearOffPopup "3D Chart", ID_EPOS_CHT_PROPS_3D_CHART_POPUP, 200
    End If
 
except that setting the caption and style properties don't show on the popup:
 
 
???


Posted By: Oleg
Date Posted: 21 November 2007 at 9:12am
Yes, its true :( caption is not supported for CommandBarSlider, Sorry.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: SReedie
Date Posted: 23 November 2007 at 5:27am
Can the caption be supported for the next release at all?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net