setting position of color picker

shannen

Registered
Hi all,
Does anybody know how I can get the PickColor control to start-up at a specified position? I tried setting the value in the following ways (psuedo code):
ColorPickerInfo.placeWhere=kAtSpecifiedOrigin;
ColorPickerInfo.dialogOrigin.v = 10;
ColorPickerInfo.dialogOrigin.h = 10;

Also, from the documentation, it mentioned that the dialogOrigin structure is suppose to contain the position of the dialog when it returns. Apparently, the debugging information that I got did not contain this. Appreciate for all help rendered and thank you very much once again
 
Hi all,
Is everybody clueless to my problem? I really appreciate if anyone could help me with any types of possible solution. Thank you very much once again
 
Does it work? If not, it might be saying that it starts at that distance from the default, which I believe is right next to the window you're selecting from. I'm not sure how to get it to behave correctly.
 
ai....sad to say, it does not work and tt't y i badly needed help on this. in fact, it does not even come out on the side of the window. it appears in the center of the screen, just like setting the placeWhere flag to the center. HELPPPPPP
 
Thanks for the link provided. that was the exact one that i used to reference and came up with the stated code but it failed to work....oh my god!!!! i am so helpless........:(
 
Hi,
The following is the function that I wrote to prompt the ColorPicker dialog. The input parameter is the color that I wanted the dialog to pick. Everything works except for the position setting. Thank you all so much.

>>>>>>>>>>>>>>>>>>>>
*/
bool CDialogs::promptObjectTimebarColor( ::CColor& ioColor )
{
bool theUserSelected = false;

::CColor theStateColor = ioColor;
CMRGBColor theColor = { theStateColor.GetRed( ) * 256, theStateColor.GetGreen( ) * 256, theStateColor.GetBlue( ) * 256 };
NPMColor thePMColor = { NULL, theColor };

long theVal;
::Gestalt(gestaltColorPickerVersion, &theVal );
// Initialize the color picker
NColorPickerInfo theInfo;
theInfo.theColor = thePMColor;
theInfo.dstProfile = NULL;
//theInfo.placeWhere = kCenterOnMainScreen;
theInfo.placeWhere = kAtSpecifiedOrigin;
theInfo.dialogOrigin.v = 0;
theInfo.dialogOrigin.h = 0;
theInfo.pickerType = 0;
theInfo.eventProc = NULL;
theInfo.colorProc = NULL;
theInfo.colorProcData = 0;

short theR;
short theG;
short theB;

// Run the color picker and if there wansn't an err, then set the color
if ( ( NPickColor( &theInfo ) == noErr ) && ( theInfo.newColorChosen ) )
{
theR = theInfo.theColor.color.rgb.red / 256;
theG = theInfo.theColor.color.rgb.green / 256;
theB = theInfo.theColor.color.rgb.blue / 256;
ioColor = ::CColor( theR, theG, theB );
theUserSelected = true;
}
return theUserSelected;
}
 
sure i can but why is there a need? Pardon me for my ignorance. Is it some devt tools specific stuff? I am using code warrior. Let me know how you want me to enclose it? (every line ?) thanks again
 
Back
Top