Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Page 1 of 2 12 LastLast
Results 1 to 8 of 12
  1. #1
    shannen is offline Registered User
    Join Date
    Jun 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    setting position of color picker

    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

  2. #2
    shannen is offline Registered User
    Join Date
    Jun 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  3. #3
    Arden's Avatar
    Arden is offline Where mah "any" keys at?
    Join Date
    Dec 2002
    Location
    Spokane, WA
    Posts
    7,752
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Systems:
    2.5 GHz MacBook Pro Core 2 Duo, 4 GB RAM, 320 GB hard drive, runs 10.6.8
    1.6 GHz iMac G5, 1.5 GB RAM, 120 GB hard drive, runs 10.4.11 (out of commission)
    iPhone 4, 16 GB, iOS 4.3.5

  4. #4
    shannen is offline Registered User
    Join Date
    Jun 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  5. #5
    tjw
    tjw is offline Registered User
    Join Date
    Oct 2002
    Location
    Salt Lake City, Utah, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not familiar with Carbon, but I did find this: http://developer.apple.com/documenta...ger/index.html

  6. #6
    shannen is offline Registered User
    Join Date
    Jun 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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........

  7. #7
    tjw
    tjw is offline Registered User
    Join Date
    Oct 2002
    Location
    Salt Lake City, Utah, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you attach the code in question so i/we could play with it?

  8. #8
    shannen is offline Registered User
    Join Date
    Jun 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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;
    }

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problems setting up proftpd server
    By balence81 in forum Mac OS X System & Mac Software
    Replies: 3
    Last Post: February 20th, 2003, 10:27 PM
  2. Change the monitor setting from the CML?
    By fddi1 in forum Unix & X11
    Replies: 0
    Last Post: August 21st, 2002, 12:36 PM
  3. What are the setting for a Slave 60gig hardrive
    By petros2929 in forum Hardware & Peripherals
    Replies: 0
    Last Post: December 23rd, 2001, 07:57 PM
  4. Monitor Resolution setting?
    By boysimple in forum Mac OS X System & Mac Software
    Replies: 5
    Last Post: December 21st, 2001, 02:34 AM
  5. How to disable IE from changing my internet setting?
    By PoweMACuser in forum Apple News, Rumors & Discussion
    Replies: 1
    Last Post: November 8th, 2001, 10:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •