Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan5-Feb-12 23:17
mveRichard MacCutchan5-Feb-12 23:17 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1235-Feb-12 23:38
Fallen1235-Feb-12 23:38 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 0:04
mveRichard MacCutchan6-Feb-12 0:04 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 0:35
Fallen1236-Feb-12 0:35 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 1:14
mveRichard MacCutchan6-Feb-12 1:14 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 2:16
Fallen1236-Feb-12 2:16 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 3:03
mveRichard MacCutchan6-Feb-12 3:03 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 6:35
Fallen1236-Feb-12 6:35 
Well it worked - Damn so simple

Now I can dynamically create/link any control without resorting to a frame class
directly to another - transparent to the Main dialog -- very useful

Derived a class from CToolbar toolbaradv
passed it the CWnd * pointer to ListboxAdv window -- m_Creator

Added handler
C++
void toolBarAdv::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMCLICK pNMClick = reinterpret_cast<LPNMCLICK>(pNMHDR);
	m_Creator->SendMessage(10001,GetToolBarCtrl().GetHotItem());
	*pResult = 0;
}


And caught the message in Derived listbox WndProc

All without having to touch the main parents message loop
And No "getting tied in knots trying to solve a problem that doesn't exist."
The problem has always been MS arrogance that "They have covered all the bases"
and not left room for expansion

A Class (or derived class) should be able to handle its messages pertaining to that class -- An options bar certainly qualifies -- you don't handle options local to the class externally --thats just bad widget design

This all got started because MS CListbox Doesn't allow access to resize its working area for the list

Example. A clistbox (no integral height),you add items and suddenly a scrollbar appears
(So a child scrollbar was Dynamically added and the listbox internals were recalculated to accomodate it --A variant of what I'm trying to do - Add a needed child) -- but try to find/modify the bloody routines that recalculate.
Basically I'm doing the same thing - Simply add a toolbar pertaining to options for the new derived listbox --Though not actually "in" but on in this case

PS in my dialogs I have 10 of these Listboxes -- think of the handling in main dialog message loop

Well nap time
QuestionSegFault Pin
chidacode5-Feb-12 7:07
chidacode5-Feb-12 7:07 
AnswerRe: SegFault Pin
Albert Holguin5-Feb-12 8:45
professionalAlbert Holguin5-Feb-12 8:45 
AnswerRe: SegFault Pin
CPallini5-Feb-12 21:57
mveCPallini5-Feb-12 21:57 
GeneralRe: SegFault Pin
Albert Holguin6-Feb-12 10:14
professionalAlbert Holguin6-Feb-12 10:14 
AnswerRe: SegFault Pin
Stephen Hewitt6-Feb-12 4:07
Stephen Hewitt6-Feb-12 4:07 
QuestionTCP/IP problems Pin
ForNow4-Feb-12 16:27
ForNow4-Feb-12 16:27 
AnswerRe: TCP/IP problems Pin
Mohibur Rashid5-Feb-12 4:34
professionalMohibur Rashid5-Feb-12 4:34 
AnswerRe: TCP/IP problems Pin
Albert Holguin5-Feb-12 8:42
professionalAlbert Holguin5-Feb-12 8:42 
GeneralRe: TCP/IP problems Pin
ForNow5-Feb-12 12:14
ForNow5-Feb-12 12:14 
GeneralRe: TCP/IP problems Pin
Albert Holguin5-Feb-12 13:46
professionalAlbert Holguin5-Feb-12 13:46 
GeneralRe: TCP/IP problems Pin
ForNow5-Feb-12 16:05
ForNow5-Feb-12 16:05 
Questionsystem phisycal drive Pin
RomTibi4-Feb-12 6:15
RomTibi4-Feb-12 6:15 
AnswerRe: system phisycal drive Pin
Rajesh R Subramanian4-Feb-12 8:15
professionalRajesh R Subramanian4-Feb-12 8:15 
GeneralRe: system phisycal drive Pin
RomTibi5-Feb-12 2:04
RomTibi5-Feb-12 2:04 
GeneralRe: system phisycal drive Pin
Jochen Arndt5-Feb-12 3:00
professionalJochen Arndt5-Feb-12 3:00 
GeneralRe: system phisycal drive Pin
RomTibi5-Feb-12 3:12
RomTibi5-Feb-12 3:12 
GeneralRe: system phisycal drive Pin
Jochen Arndt5-Feb-12 3:25
professionalJochen Arndt5-Feb-12 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.