 |
|
 |
It's very sad that this havent been updated for centuries now
Best .NET Rebar implimentation on the net!
-= Really cool sig goes here =-
|
|
|
|
 |
|
 |
Just a note, this approach is no longer necessary in .NET 2.0. Use a ToolStripContainer and you can raft as many ToolStrips as you want in a single container, giving out-of-the-box floating toolbars. Just hope to save people some trouble if you've already got the tools to do what you need.
|
|
|
|
 |
|
 |
The way to show chevrons in rebar band is adding RBBS_USECHEVRON constant in Style property of BandWrapper component. This can be do it by adding a new boolean field _useChevron to BandWrapper class, and modifing Style property as follows:
protected int Style
{
get {
...
if(_useChevron)
style |= (int)RebarBandStyleConstants.RBBS_USECHEVRON;
...
return style
}
set {
...
_useChevron = !((value & (int)RebarBandStyleConstants.RBBS_USECHEVRON)
== (int)RebarBandStyleConstants.RBBS_USECHEVRON);
...
}
}
Also, it's very important to modify CreateBand method, adding the following line before creating the band (call to SendMessage):
rbBand.fMask |= (uint) RebarBandInfoConstants.RBBIM_IDEALSIZE;
To trap when a user clicks the chevron you will need to handle RBN_CHEVRONPUSHED to display a dropdown menu. Add a new case in WndProc of RebarWrapper class:
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if(_rebar != null && m.Msg == (int)WindowsMessages.WM_NOTIFY)
{
NMHDR Notify = (NMHDR)Marshal.PtrToStructure(m.LParam,typeof(NMHDR));
if(Notify.idFrom == 1)
{
switch((int)Notify.code)
{
...
case ((int)WindowsNotifyConstants.RBN_CHEVRONPUSHED):
this.NotifyChevronPushed(ref m);
break;
...
}
}
}
}
and a new method:
private void NotifyChevronPushed(ref Message message)
{
WindowsUtilities.NMREBARCHEVRON nrch =
(WindowsUtilities.NMREBARCHEVRON)message.GetLParam(
typeof(WindowsUtilities.NMREBARCHEVRON));
int index = nrch.wID;
if( (index >= 0) && (index < this._bands.Count ) &&
( this._bands[index] != null))
{
Point point = new Point(nrch.rc.left, nrch.rc.bottom);
this._bands[index].Show(this, point);
}
}
This method uses struct NMREBARCHEVRON. Add this struct to WindowsUtilities namespace in file RebarStructs.cs:
[StructLayout(LayoutKind.Sequential)]
public struct NMREBARCHEVRON
{
public NMHDR hdr;
public int uBand;
public int wID;
public int lParam;
public RECT rc;
public int lParamNM;
}
Finally, you must create a public Show method in BandWrapper class:
public void Show(Control control, Point point) { }
This method is responsible of showing a popup context menu or toolbar that include items not shown in toolbar. By now, I'm implementing this method following the guidelines from http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/ShellCC/platform/commctls/faq/ietoolbar.asp.
|
|
|
|
 |
|
 |
Hi all,
I found an interesting rebar sample which has chevron and menubar support. But it lacks some features which this control have. Can anybody combine the features of both for me? Here is the link : http://www.aisto.com/roeder/dotnet/Download.aspx?File=CommandBar[^]
Thanks in advance.
The Refresh() on the RebarWrapper.OnResize() must be changed to Invalidate() to avoid flickering during resize.
|
|
|
|
 |
|
 |
Where can I find definitions for different API functions and the structs that they use? For example for REBARABANDINFO.
|
|
|
|
 |
|
 |
They're defined in header (.h) files in the platform SDK, that's installed along with VS.NET.
mav
|
|
|
|
 |
|
 |
I was being lazy hoping that someone had already converted those to C#. ;D
|
|
|
|
 |
|
 |
In that case you might want to take a look at pinvoke.net[^].
mav
|
|
|
|
 |
|
 |
Maybe they will have a control like this in whidbey? anyone know where I can find a list of new controls that will be available?
Nice wrapper BTW
www.CoderForRent.com
|
|
|
|
 |
|
 |
yup it's even included in the free C# Express 2005.
|
|
|
|
 |
|
 |
How can i set up a rebar for runtime width resize? I'm using vertical rebar, it's running OK but i don't know how to change width of band when program is running.
Thanks
|
|
|
|
 |
|
 |
to all: i am very new to C# development, my background is more J2EE (with some VB some time ago). i am looking to make a floating toolbar in a very effiencient way. i have tried a couple of working hacks, but that's not what i am after.
thanks,
rob
--------------------------------------------------------------------
"There are 10 types of people in the world those who understand binary and those who don't."
|
|
|
|
 |
|
 |
Actually I am more concern about the application productive, of course I'm very appreciate who create the nice control to share with us. So, it's the Rebar Control Wrapper bug free already?
Melvin
|
|
|
|
 |
|
 |
If you add 2 bands in the rebar wrapper, set the new row attributes to false and place them in one row, you will find the rebar works well unless you minimize the form and restore it. The problem is that the toolbar allocates 2 rows on the screen not one. The second row that should not appear is painted as a gray rectangle.
|
|
|
|
 |
|
 |
The simple workaround:
in RebarWrapper.cs:
in method protected override void OnResize(System.EventArgs e)
replace:
if(Width != _rebar.BarWidth)
with:
if(Width != _rebar.BarWidth && Width != 0)
this avoids setting rebar's width to 0 when form is minimized.
Maybe, similar thing must be done with Vertical rebar.
|
|
|
|
 |
|
 |
After struggling to find out why the chevron code wasn't working properly when the child size changed, I stumbled upon a bug in the UpdateMinimums function. It was just sitting there, waiting to be discovered. A small but important code omisson. Apparently, the fMask is being set to only RBBIM_CHILDSIZE, and not also RBBIM_IDEALSIZE, causing the IdealSize member to never be updated since the band's creation.
Here's the updated code (BandWrapper.cs):
protected void UpdateMinimums()
{
if(Created)
{
REBARBANDINFO rbBand = new REBARBANDINFO();
rbBand.cbSize = (uint)Marshal.SizeOf(rbBand);
rbBand.fMask = (uint)(RebarBandInfoConstants.RBBIM_CHILDSIZE|RebarBandInfoConstants.RBBIM_IDEALSIZE);
if (_header != -1) rbBand.fMask |= (uint)RebarBandInfoConstants.RBBIM_HEADERSIZE;
rbBand.cxMinChild = (uint)_minWidth;
rbBand.cyMinChild = (uint)_minHeight;
rbBand.cyIntegral = (uint)_integral;//1;
rbBand.cyChild = (uint)_minHeight;
rbBand.cyMaxChild = 300;
rbBand.cxIdeal = (uint)_idealWidth;
rbBand.cxHeader = (uint)_header;
if(User32Dll.SendMessage(_bands.Rebar.RebarHwnd, (int)WindowsMessages.RB_SETBANDINFOA, BandIndex ,ref rbBand) == 0)
{
int LastErr = Marshal.GetHRForLastWin32Error();
try
{
Marshal.ThrowExceptionForHR(LastErr);
}
catch (Exception ex)
{
Console.WriteLine(LastErr + " " + ex.Message);
if (_throwExceptions) throw(new Exception("Error Updating Minimums.", ex));
}
}
}
}
I have a symbiotic relationship with my computer.
|
|
|
|
 |
|
 |
You really could do this without API calls.
Chris Pietschmann, MCSD, MCAD
http://www.PietschSoft.com
|
|
|
|
 |
|
 |
How? I've been watching your site for a year now, and I stil can't find a clue to what sollution you have in mind.
|
|
|
|
 |
|
 |
I have not had the time to write a control like this that doesn't use API's. But I do know its possible.
Christopher Pietschmann, MCSD, MCAD
http://PietschSoft.com/Blog
http://SlapDev.com
|
|
|
|
 |
|
 |
Troll!
-= Joe McConnell =-
|
|
|
|
 |
|
 |
By all means enlighten us.
-= Really cool sig goes here =-
|
|
|
|
 |
|
 |
Could someone please help me understand how to position the bands properly? I have too many bands for one row. The first band in the row is positioned properly, left justified, but all other bands in that row are positioned from right to left. I would like all bands to be positioned next to each other upon startup. I looked at the code and tried everything I know of to reposition them properly but nothing seems to work. Is this a bug or am I doing something wrong? Thx.
|
|
|
|
 |
|
 |
I used this RebarWrapper in desiger mode ,but the bands Collection has some
problem ,when i add a band ,i can't delete it from the CollectionEditor.
Can you help me ?
|
|
|
|
 |
|
 |
Please tell me that how can i implement a floating toolbar window
Namely ,I can drag and drop a toolbar and make it be a floating toolbarwindow
I'm a Chinese ,My English is poor .
My E-Mail is hbchen33@163.com
Can you help me to solve this problem
|
|
|
|
 |
|
 |
I love this rebar. Excellent work, and thanks a lot.
|
|
|
|
 |