Click here to Skip to main content
15,843,865 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 0:17
mveRichard MacCutchan6-Feb-12 0:17 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 0:38
Fallen1236-Feb-12 0:38 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 1:04
mveRichard MacCutchan6-Feb-12 1:04 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 1:35
Fallen1236-Feb-12 1:35 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 2:14
mveRichard MacCutchan6-Feb-12 2:14 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 3:16
Fallen1236-Feb-12 3:16 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Richard MacCutchan6-Feb-12 4:03
mveRichard MacCutchan6-Feb-12 4:03 
GeneralRe: VS 2010 MFC derived CListbox with dynamically addedCtoolbar Pin
Fallen1236-Feb-12 7:35
Fallen1236-Feb-12 7: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 8:07
chidacode5-Feb-12 8:07 
AnswerRe: SegFault Pin
Albert Holguin5-Feb-12 9:45
professionalAlbert Holguin5-Feb-12 9:45 
AnswerRe: SegFault Pin
CPallini5-Feb-12 22:57
mveCPallini5-Feb-12 22:57 
GeneralRe: SegFault Pin
Albert Holguin6-Feb-12 11:14
professionalAlbert Holguin6-Feb-12 11:14 
AnswerRe: SegFault Pin
Stephen Hewitt6-Feb-12 5:07
Stephen Hewitt6-Feb-12 5:07 
QuestionTCP/IP problems Pin
ForNow4-Feb-12 17:27
ForNow4-Feb-12 17:27 
AnswerRe: TCP/IP problems Pin
Mohibur Rashid5-Feb-12 5:34
professionalMohibur Rashid5-Feb-12 5:34 
AnswerRe: TCP/IP problems Pin
Albert Holguin5-Feb-12 9:42
professionalAlbert Holguin5-Feb-12 9:42 
GeneralRe: TCP/IP problems Pin
ForNow5-Feb-12 13:14
ForNow5-Feb-12 13:14 
GeneralRe: TCP/IP problems Pin
Albert Holguin5-Feb-12 14:46
professionalAlbert Holguin5-Feb-12 14:46 
GeneralRe: TCP/IP problems Pin
ForNow5-Feb-12 17:05
ForNow5-Feb-12 17:05 
Questionsystem phisycal drive Pin
RomTibi4-Feb-12 7:15
RomTibi4-Feb-12 7:15 
AnswerRe: system phisycal drive Pin
Rajesh R Subramanian4-Feb-12 9:15
professionalRajesh R Subramanian4-Feb-12 9:15 
GeneralRe: system phisycal drive Pin
RomTibi5-Feb-12 3:04
RomTibi5-Feb-12 3:04 
GeneralRe: system phisycal drive Pin
Jochen Arndt5-Feb-12 4:00
professionalJochen Arndt5-Feb-12 4:00 
GeneralRe: system phisycal drive Pin
RomTibi5-Feb-12 4:12
RomTibi5-Feb-12 4:12 
GeneralRe: system phisycal drive Pin
Jochen Arndt5-Feb-12 4:25
professionalJochen Arndt5-Feb-12 4: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.