toolbar #2

Hi,
I'm still having trouble with text on the right on toolbar.

ex.
if (!m_wndToolBar.CreateEx(this, TBSTYLE_LIST.....
.....

 DWORD dwExStyle = TBSTYLE_EX_DRAWDDARROWS|TBSTYLE_EX_MIXEDBUTTONS ;
 m_wndToolBar.GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0,
(LPARAM)dwExStyle);

DWORD dwStyle =
m_wndToolBar.GetButtonStyle(m_wndToolBar.CommandToIndex(ID_NEW));
 m_wndToolBar.SetButtonText(m_wndToolBar.CommandToIndex(ID_NEW), "New");
 m_wndToolBar.SetButtonStyle(m_wndToolBar.CommandToIndex(ID_NEW),
dwStyle|BTNS_SHOWTEXT);

and at lease I need to setup button sizes like
m_wndToolBar.GetToolBarCtrl().SetButtonSize(...).
Because user can define custom toolbar font and its size, I don't know how
Can I count value for SetButtonSize. And of course, there isn't only short
text like in example, but there is also the text, which is much longer.

Thank you for any help
    Robert




0
2/25/2004 7:34:06 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
553 Views

Similar Articles

[PageSpeed] 2

I'm having similar trouble.  My current approach is to iterate over
all buttons in the toolbar calling GetItemRect for each.  I sum all
the widths and then calculate the average width.  I use this avg width
in the call to SetButtonSize.  You must be careful not to include the
droparrow rect for BTNS_DROPDOWN buttons or the width of BTNS_SEP
buttons.  Including these in your avg width calc will make the toolbar
too wide.  I've created a function to do this called AdjustSize().
Note: AdjustSize() needs to be called whenever a button is added,
removed, hidden, or text is shown for a button.  I can provide some
sample code if you want.

This soln is not optimal.  It results in a toolbar size that is close
to the right size, but not quite right.  There has got to be a better
way to force the toolbar to resize!?!  If you figure anything out, I
would be very interested.

<rant>
As a matter of fact, I'm having a bunch of different problems with
toolbars right now.  The documentation is horrible and no one on the
usual news groups seems to have any ideas of how to help.  I am so
sick of reading "...call CFrameWnd::RecalcLayout()..." -- for me, this
has been no help whatsoever.

BTNS_AUTOSIZE and CToolBarCtrl::AutoSize() seem to do nothing.

Assigning text to a button seems to cause the button to grow larger in
x and y dir, but the toolbar does not resize.

Wrapping is a nightmare

etc...

I'm beginning to realize that if you want modern looking, custom
toolbars you have to implement from scratch and avoid the MFC CToolBar
class.

If anyone knows of a good reference/book for how to customize
toolbars, please let me know!
</rant>

-Frank


"Robert Camsky" <robertcamsky@atlas.cz> wrote in message news:<OgSbga9#DHA.1464@tk2msftngp13.phx.gbl>...
> Hi,
> I'm still having trouble with text on the right on toolbar.
> 
> ex.
> if (!m_wndToolBar.CreateEx(this, TBSTYLE_LIST.....
> ....
> 
>  DWORD dwExStyle = TBSTYLE_EX_DRAWDDARROWS|TBSTYLE_EX_MIXEDBUTTONS ;
>  m_wndToolBar.GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0,
> (LPARAM)dwExStyle);
> 
> DWORD dwStyle =
> m_wndToolBar.GetButtonStyle(m_wndToolBar.CommandToIndex(ID_NEW));
>  m_wndToolBar.SetButtonText(m_wndToolBar.CommandToIndex(ID_NEW), "New");
>  m_wndToolBar.SetButtonStyle(m_wndToolBar.CommandToIndex(ID_NEW),
> dwStyle|BTNS_SHOWTEXT);
> 
> and at lease I need to setup button sizes like
> m_wndToolBar.GetToolBarCtrl().SetButtonSize(...).
> Because user can define custom toolbar font and its size, I don't know how
> Can I count value for SetButtonSize. And of course, there isn't only short
> text like in example, but there is also the text, which is much longer.
> 
> Thank you for any help
>     Robert
0
fjlaga (3)
3/2/2004 9:17:36 PM
Reply:

Similar Artilces:

Posting Cash Receipts #2
Occasionally, when we are posting cash receipts, the system seems to lock up. Specifically, when we are in the Apply Sales Documents window, we have marked some invoices to apply a payment, and then we try to scroll down to invoices farther down the list. The Apply Sales Documents window flashes every couple of seconds, and does not scroll down the list as expected. We are unable to click elsewhere in the window when this happens, until the system "catches up" to our scrolling. This has happened to us maybe 3-4 times in the last 4 months, and it has lasted anywhere from 3-...

removing 1st e2k #2
We have followed the MS article 307917 to remove the 1st e2k (master) from the exchange organization. We have moved all users mailbox to the e2k3 (member) and rehomed all the necessary files and folders from e2k to e2k3. However, the article do not address DNS and additional connectors. I have an smtp connector created on the e2k due to other smtp servers that need to relay. It has the the * and cost of 1. How can I change this so that the E2K3 now becomes the servers for all the other smtp servers to relay too. Also the E2K currently have a public IP as well as an MX record on o...

Pivot Tables + Color + Dynamic Content generation and display #2
I have a dynamically generated pivot table (generated from actions in another spreadsheet - number of rows and location keeps changing - cant use conditional formatting). The data I currently have displayed on the pivot table is: Resource Project Allocation Jan Allocation Feb -------- ------- -------------- -------------- Resource1 Project1 0.5 0.5 Resource1 Project1 0.25 0.5 Resource1 Total 0.75 1.0 Resource2 Project1... .. I need to (1) Highlight, in red, items where Resource totals are less than 1.00. e.g. Resource 1 Total. Just...

scripts #2
Have migrated 1000 users form an nt domain to AD with 2003 server. Still attaching to the old 5.5 org for email. We will chnage over to anew 2003 exchnage org all at once. Is there a login-script or anything in group policies that will change the server name in Outlook, to point to the new 2003 exchange server? thanks If your using outlook to connct, you can take a look at the office resouce kit. There's a tool called the profile wizard. That might be at your service. Jurgen Voogd MCSE/CNA Systems Engineer <AKG414S@YAHOO.COM> wrote in message news:193af01c41c4e$225fd870$a3...

Cannot Promote E-mail from InBox in CRM 1.2
Hello! We have a successful installation of CRM 1.2, but we have been unable to use the "Promote to CRM Activity" feature in SFO. We have installed many of the updates and hot-fixes, but we continue to have this problem. The error shuts down Outlook, and points to the CRMADDIN.DLL add-in. We've removed it and re-installed it several times, but continue to have the same problem. Is there something we are missing, since I do not see many others with this type of problem. Thank you kindly, John what error do you get? also have you verified the problem the user is reporting...

From Entourage 2004 to 2008 (H&S) to 2008 Standard #2
When I installed 2008 Home &amp; Student, all my data came along for the ride. I just purchased 2008 Standard for the Exchange Support and am wondering if my data will STILL come along for the ride when I install the Standard edition.<br> <br> Thanks in advance for your help! On 1/31/08 6:10 PM, in article ee8b96e.-1@webcrossing.caR9absDaxw, "Arty09@officeformac.com" <Arty09@officeformac.com> wrote: > When I installed 2008 Home & Student, all my data came along for the ride. I > just purchased 2008 Standard for the Exchange Support and am wondering i...

Conditional Formatting dates #2
In column A are dates starting at 01/01/2004 and going to 12/31/2004 by day. I want to use conditional formatting to highlight paydates. The best logic I can 'write' is ... starting (and including) on Jan 2nd, 2004 and every 14 days thereafter, highlight the cell blue. Can anyone give me a solution to do that? TIA, AlanN Alan, Use a CF condition of Formula Is, with a formula of =MOD(A1,14)=6 then format as required -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "AlanN" <me@...

grouping cells #2
Is there a way to group cells together? I am sorting data on one sheet and this changes 1 column in another sheet. I need to have all data in a row where the 1st column sorted to move with the value from the 1st column. If I could group them together or somehow link the whole row then if the 1st column changes the rest of the info in that row would go as well. Any thoughts? Thanks, John John, In your rows, you need to have formulas (typically, VLOOKUP formulas) that extract the data based on the value of the first column (if it is unique).... HTH, Bernie MS Excel MVP "johnrb78...

Lookup when value is between 2 columns
Hi, I need to lookup a column if the value is between the first 2 columns Col 1 Col2 Col3 Col 4 1 5 Yes 10 6 10 Yes 20 11 15 No 30 If the value I am looking up is 7, I need to return Yes from Col 3. So if value is between col 1 and col 2, return Col 3. I was able to get Col 4 using Sum (if..) but do not know how to return the text in Col 3 Thanks in advance.. If column 1 is in E2 and Col 2 is F2 Col 3 = =IF(OR(E2<=$G$1,F2<=$G$1),"Yes","No") For column 4 I used =(INT(MAX(E2:F2)/$G$1)+1)*10 G1 is the number to di...

Encoding #2
i have encountered a problem. all users using MS Outlook 2003 sp2 (operating system is Windows XP SP2). With the same email message (with chinese text), some machine can encode the text to readable chinese text but some cannot. ...

Icons on Customized Toolbar
does anyone know where i can find more icon options for my customized toolbar (16x16 pixels)? excel provides about 30 default images but i'm looking for some more specific objects. thanks much, tami Excel provides many more command button images than the 30 or so that are displayed on the customization dialog. You can assign any of Excel's hundreds of button faces to you command button. E.g., Btn.FaceID = 1234 Associating a FaceID value with an icon image could be tedious, but John Walkenbach has a nice add-in at http://spreadsheetpage.com/index.php/tip/identifying_...

How Do you Lock the Toolbar?
Is there any way to lock the toolbar in excel. I keep on accidentally moving things around. No. I think the reason for locking the toolbars in the browsers is to protect you from websites that hijack your home page at least I've never seen it mentioned in any other context. When you change the size of the window things are going to move around. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Jeff" <Jeff@discussi...

Headers #2
Could someone please!!!! tell me how to stop an object placed into a header from repeating on the previous pages. I have tried using section breaks before and after the page I want the object to be on, but it keeps showing up on all the other pages. -- mammore mammore wrote: > Could someone please!!!! tell me how to stop an object placed into a > header from repeating on the previous pages. I have tried using > section breaks before and after the page I want the object to be on, > but it keeps showing up on all the other pages. ======================= Maybe it's on the M...

BOND CALCULATIONS & GRAPHING #2
Myrna, Thanks for your reply. I am a CPA, although I don't practice as one, as well. I am aware o most, if not all, of the tax basis complexities that you referred to. I am not looking for a template to calculate tax basis for a specifi security; I have access to a Bloomberg terminal which does that ver efficiently. I am looking for a more generic, although accurate approach that would display amortization of premium and accrual of OI graphically over time. I realize that some simplifying assumption would have to be made: e.g., only taxable, or only tax-exempt (m preference); if on...

GP should allow more than 2 decimals for vacation accrual
Our vacation accrual per pay period is 6.6666. GP limits the decimal to 2 places. Should be allowed to go to 4 or 5. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=9177...

placing style separator icon onto formatting toolbar
I had the style separator icon on my formatting toolbar (Microsoft 2003 Word) and it has been deleted. How do I put it back there? Thank you. ...

CRM integration #2
Hi, CRM is quite new (well very new!!) to me - and I am playing with Data Integration. I have the following to ask: I have a SQL Server Table with Customer Account Details. A master application feeds this table with information form a mainframe system. This SQL Table contains the master source of the data. The problem is that I need to do integration between this SQL Account table and CRM. Thus, I have to consider 3 operations that might be exercised on the Records namely: CRMAccount.Create() CRMAccount.Update() CRMAccount.MarkAsDeleted() If Data is inserted into the SQL Table, a ...

Error installing Lookout 1.2
Downloaded Lookout 1.2 from MS website, and installed it. Opened Outlook 2K3 SP1, and get the following error: "You may have recieved an error message about "Exchange Extensions". Lookout can try top repair this file for you by repairing your HKLM\SOFTWARE\Microsoft\Exchange\Client\Extensions\Exchang e Extensions setting. Details will be logged in case you want to undo the repair. Would you like to repair it now? y/n" The install for Lookout went fine, with no errors, and Outlook was not loaded at the time. Can't find this error referenced anywhere. Should I ha...

Title Bar Caption in Excel #2
I want to change the caption in the Title Bar of Excel, does anyone know how to do this, or even if it's possible? Any suggestions would be great. Thank you, Cory ...

Outlook Connector Problem #2
I am using MSN Outlook Connector with Windows 2000 Pro. I cannot get Outlook to open when I select the option to send a file as an attachment from within Excel. Instead, MSN Explorer insists on opening, and unfortunately MSN Explorer gives Excel files a .tmp extension and then decides the attachment is unsafe and deletes the attachment. How do I get Outlook to open and not MSN Explorer. TIA Ron Bernier ...

recover deleted email #2
I set up a 'rule' in Outlook that permanently deleted a very important incoming message. Is there any way to recover this? The rule went something like this: 'when messages received by (so and so) permantely delete it' HELP!! beagledogs <anonymous@discussions.microsoft.com> wrote: > I set up a 'rule' in Outlook that permanently deleted a > very important incoming message. Is there any way to > recover this? If your Inbox is on an Exchange server, then yes, if your Exchange Admin has enabled this feature. Ask him or her. If your Inbox is in a P...

OUTLOOK 2007 PROBLEM #2
Here is my problem: My ISP is COX, and I'm running Outlook 2007 on windows xp with serv pk 2 I can't send/receive mail. My Virus program is Trend-Micro. I set up each account with east as my pop and smtp. Each time when it looks for mail, I'm prompted for my password, I click ok, and each time it is rejected. If I use Outlook express, there isn't a problem logging into the east server, with one email account. Also, if I go to web mail at cox, I don't have any problems logging into both my accounts, so I know it isn't a password issue. This is a new harddrive and...

2 columns -> 1 column
Hello all I have 2 columns and i want to make a 1 column as follows: a b a c d b e f => c g h d i j e .. f .. g .. h .. i .. j Any help would be appreciated. Danny Hi Danny, On another worksheet you can refer to the first by it's s...

Excel Option Conflicts #2
I need a workbook to run with specific options which may conflict with options already established by open workbooks sharing the same EXCEL.exe process. e.g one workbook needs "Manual Calculation", others "Automatic Calculation" I believe one solution is to ensure that whenever this workbook is opened, it runs (exclusively) a new EXCEL.exe process. How can I ensure this works for all users accessing this file? Or is there a smarter way? I don't think that there is a way to ensure this. You could give them instructions, you could give them a workbook that crea...

Free iPod 20gb! #2
Hey there, I just found this pretty neat site that is giving away free stuff, such as the new 20GB iPod, a 20.1" wide screen LCD monitor from Dell, a home theater system, a 30GB iPod Photo, or CASH. It is completely legitimate, and thousands of people have received their products from the free sites so far. http://www.tech4free.com/default.aspx?ref=397574 ...