About Store Forum Documentation Contact



Post Reply 
How to make color picker, like the one in editors ?
Author Message
mih Offline
Member

Post: #1
How to make color picker, like the one in editors ?
Hi smile As in the title, I would like to make the color picker to popup when user click on the 'color rectangle'. I'm wondering how It was made in the tools provided with engine, any tips Grzegorz smile ?
06-14-2010 08:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: How to make color picker, like the one in editors ?
you can use ColorPicker class, it's available to use
06-14-2010 09:30 PM
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #3
RE: How to make color picker, like the one in editors ?
Yes I know smile I think i didn't write it clearly xD I would like to make something like that:
user clicks on the rectangle filled with color, and then color picker window pops up, and after closing color picker, rectangle is filled with new color wink I was trying to make It with GuiImage control, but I don't know how to detect when user clicks on It smile
I was rather asking, about that filled rectangle smile What is the easiest way to achive somthing like that ?
(This post was last modified: 06-14-2010 10:40 PM by mih.)
06-14-2010 10:40 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: How to make color picker, like the one in editors ?
Code:
static void ColorDraw(GuiCustom &gc)
{
   Property &prop=*(Property*)gc.user;
   Rect      rect=gc.rect+gc.gpc->offset;
   if(prop._cp)rect.draw((*prop._cp)().v3);
               rect.draw(Color(0,0,0,0x70),false);
}
static void ColorUpdate(GuiCustom &gc)
{
   if(Gui.ms()==&gc && Ms.bp(0))
   {
      Property &prop=*(Property*)gc.user;
      if(prop._cp)prop._cp->activate();
   }
}
06-15-2010 10:32 AM
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #5
RE: How to make color picker, like the one in editors ?
thanks, I'll try that smile
06-15-2010 11:09 AM
Find all posts by this user Quote this message in a reply
Post Reply