"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer4/PopUp.cpp" between
pymol-open-source-2.2.0.tar.gz and pymol-open-source-2.3.0.tar.gz

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

PopUp.cpp  (pymol-open-source-2.2.0):PopUp.cpp  (pymol-open-source-2.3.0)
skipping to change at line 48 skipping to change at line 48
#define cPopUpTitleHeight DIP2PIXEL(19) #define cPopUpTitleHeight DIP2PIXEL(19)
#define cPopUpBarHeight DIP2PIXEL(4) #define cPopUpBarHeight DIP2PIXEL(4)
#define cPopUpCharWidth DIP2PIXEL(8) #define cPopUpCharWidth DIP2PIXEL(8)
#define cPopUpCharMargin DIP2PIXEL(2) #define cPopUpCharMargin DIP2PIXEL(2)
#define cPopUpCharLift DIP2PIXEL(2) #define cPopUpCharLift DIP2PIXEL(2)
#define cChildDelay 0.25 #define cChildDelay 0.25
#define cPassiveDelay 0.45 #define cPassiveDelay 0.45
#define cDirtyDelay 0.05 #define cDirtyDelay 0.05
typedef struct CPopUp { struct CPopUp : public Block {
::Block *Block; Block *Parent {};
::Block *Parent; Block *Child {};
::Block *Child; int ChildLine {};
int ChildLine; int LastX {}, LastY {};
int LastX, LastY; int StartX {}, StartY {};
int StartX, StartY; int Selected {};
int Selected; int Width {}, Height {};
int Width, Height; int NLine {};
int NLine; PyObject **Sub {};
PyObject **Sub; char **Command {};
char **Command; char **Text {};
char **Text; int *Code {};
int *Code; double ChildDelay {};
double ChildDelay; double DirtyDelay {};
double DirtyDelay; double PassiveDelay {};
double PassiveDelay; int DirtyDelayFlag {};
int DirtyDelayFlag; int NeverDragged {};
int NeverDragged; int PlacementAffinity {};
int PlacementAffinity;
} CPopUp; CPopUp(PyMOLGlobals * G) : Block(G){}
void draw(CGO *orthoCGO) override;
int drag(int x, int y, int mod) override;
int release(int button, int x, int y, int mod) override;
void reshape(int width, int height) override {};
};
int PopUpRelease(Block * block, int button, int x, int y, int mod); static
void PopUpDraw(Block * block ORTHOCGOARG);
int PopUpConvertY(CPopUp * I, int value, int mode); int PopUpConvertY(CPopUp * I, int value, int mode);
/*======================================================================== /*========================================================================
* If Sub[a] is a list, return it, otherwise assume it's callable so * If Sub[a] is a list, return it, otherwise assume it's callable so
* call it, assign the result to Sub[a] and return the result. * call it, assign the result to Sub[a] and return the result.
* *
* @param Sub : array of lists or callables * @param Sub : array of lists or callables
* @param a : array index * @param a : array index
*/ */
static PyObject * SubGetItem(PyMOLGlobals * G, PyObject ** Sub, const int a) { static PyObject * SubGetItem(PyMOLGlobals * G, PyObject ** Sub, const int a) {
skipping to change at line 109 skipping to change at line 114
return elem; return elem;
ok_except1: ok_except1:
#endif #endif
return NULL; return NULL;
} }
/*========================================================================*/ /*========================================================================*/
static Block *PopUpRecursiveFind(Block * block, int x, int y) static Block *PopUpRecursiveFind(Block * block, int x, int y)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = block->m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
if(I->Child) { /* favor the child */ if(I->Child) { /* favor the child */
if(PopUpRecursiveFind(I->Child, x, y) == I->Child) if(PopUpRecursiveFind(I->Child, x, y) == I->Child)
return block; return block;
} }
if(BlockRecursiveFind(block, x, y) == block) { if(block->recursiveFind(x, y) == block) {
OrthoGrab(G, block); OrthoGrab(G, block);
return block; return block;
} }
return NULL; return NULL;
} }
/*========================================================================*/ /*========================================================================*/
Block *PopUpNew(PyMOLGlobals * G, int x, int y, int last_x, int last_y, Block *PopUpNew(PyMOLGlobals * G, int x, int y, int last_x, int last_y,
int passive, PyObject * list, Block * parent) int passive, PyObject * list, Block * parent)
{ {
skipping to change at line 137 skipping to change at line 142
return NULL; return NULL;
#else #else
/* assumes blocked threads (calls the Python C API) */ /* assumes blocked threads (calls the Python C API) */
int mx, a, l, cl, cmx; int mx, a, l, cl, cmx;
int dim[2]; int dim[2];
PyObject *elem; PyObject *elem;
const char *str, *c; const char *str, *c;
int blocked = PAutoBlock(G); int blocked = PAutoBlock(G);
int ui_light_bg = SettingGetGlobal_b(G, cSetting_internal_gui_mode); int ui_light_bg = SettingGetGlobal_b(G, cSetting_internal_gui_mode);
OOAlloc(G, CPopUp); CPopUp *I = new CPopUp(G);
I->Block = OrthoNewBlock(G, NULL); I->reference = (void *) I;
I->Block->reference = (void *) I; I->active = false;
I->Block->fDraw = PopUpDraw; I->TextColor[0] = 1.0F;
I->Block->fDrag = PopUpDrag; I->TextColor[1] = 1.0F;
I->Block->fRelease = PopUpRelease; I->TextColor[2] = 1.0F;
I->Block->active = false;
I->Block->TextColor[0] = 1.0F; I->BackColor[0] = 0.1F;
I->Block->TextColor[1] = 1.0F; I->BackColor[1] = 0.1F;
I->Block->TextColor[2] = 1.0F; I->BackColor[2] = 0.1F;
I->Block->BackColor[0] = 0.1F;
I->Block->BackColor[1] = 0.1F;
I->Block->BackColor[2] = 0.1F;
if(ui_light_bg) { if(ui_light_bg) {
I->Block->TextColor[0] = 0.0F; I->TextColor[0] = 0.0F;
I->Block->TextColor[1] = 0.0F; I->TextColor[1] = 0.0F;
I->Block->TextColor[2] = 0.0F; I->TextColor[2] = 0.0F;
I->Block->BackColor[0] = 1.0F; I->BackColor[0] = 1.0F;
I->Block->BackColor[1] = 1.0F; I->BackColor[1] = 1.0F;
I->Block->BackColor[2] = 1.0F; I->BackColor[2] = 1.0F;
} }
I->Parent = parent; I->Parent = parent;
I->Child = NULL; I->Child = NULL;
I->NLine = PyList_Size(list); I->NLine = PyList_Size(list);
I->Text = NULL; I->Text = NULL;
I->Command = NULL; I->Command = NULL;
I->Code = NULL; I->Code = NULL;
I->Selected = -1; I->Selected = -1;
I->StartX = (I->LastX = last_x); I->StartX = (I->LastX = last_x);
skipping to change at line 241 skipping to change at line 242
Py_INCREF(command); Py_INCREF(command);
I->Sub[a] = command; I->Sub[a] = command;
} }
} }
} }
/* compute height */ /* compute height */
I->Height = 1 * cPopUpCharMargin + PopUpConvertY(I, I->NLine, true); I->Height = 1 * cPopUpCharMargin + PopUpConvertY(I, I->NLine, true);
I->Block->rect.top = y; I->rect.top = y;
I->Block->rect.bottom = y - I->Height; I->rect.bottom = y - I->Height;
I->Block->rect.left = x - (I->Width) / 3; I->rect.left = x - (I->Width) / 3;
I->Block->rect.right = x + (2 * I->Width) / 3; I->rect.right = x + (2 * I->Width) / 3;
PopFitBlock(I->Block); PopFitBlock(I);
OrthoAttach(G, I->Block, cOrthoTool); OrthoAttach(G, I, cOrthoTool);
I->Block->active = true; I->active = true;
OrthoGrab(G, I->Block); OrthoGrab(G, I);
OrthoDirty(G); OrthoDirty(G);
if(passive) if(passive)
PyMOL_SetPassive(G->PyMOL, true); PyMOL_SetPassive(G->PyMOL, true);
PAutoUnblock(G, blocked); PAutoUnblock(G, blocked);
OrthoInvalidateDoDraw(G); OrthoInvalidateDoDraw(G);
return I->Block; return I;
#endif #endif
} }
/*========================================================================*/ /*========================================================================*/
int PopUpConvertY(CPopUp * I, int value, int mode) int PopUpConvertY(CPopUp * I, int value, int mode)
{ {
int result; int result;
int a; int a;
int flag; int flag;
skipping to change at line 332 skipping to change at line 333
} }
/* height to line */ /* height to line */
} }
return (result); return (result);
} }
/*========================================================================*/ /*========================================================================*/
static void PopUpDetachRecursiveChild(Block * block) static void PopUpDetachRecursiveChild(Block * block)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = block->m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
OrthoDetach(G, block); OrthoDetach(G, block);
if(I->Child) if(I->Child)
PopUpDetachRecursiveChild(I->Child); PopUpDetachRecursiveChild(I->Child);
} }
/*========================================================================*/ /*========================================================================*/
static void PopUpForgetChild(Block * block) static void PopUpForgetChild(Block * block)
{ {
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
I->Child = NULL; I->Child = NULL;
} }
static void PopUpRecursiveDetach(Block * block) static void PopUpRecursiveDetach(Block * block)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = block->m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
OrthoDetach(G, block); OrthoDetach(G, block);
if(I->Child) if(I->Child)
PopUpDetachRecursiveChild(I->Child); PopUpDetachRecursiveChild(I->Child);
if(I->Parent) { if(I->Parent) {
PopUpForgetChild(I->Parent); PopUpForgetChild(I->Parent);
PopUpRecursiveDetach(I->Parent); PopUpRecursiveDetach(I->Parent);
} }
} }
static void PopUpFree(Block * block) static void PopUpFree(Block * block)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = block->m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
#ifndef _PYMOL_NOPY #ifndef _PYMOL_NOPY
{ /* purge code */ { /* purge code */
int a; int a;
int blocked = PAutoBlock(G); int blocked = PAutoBlock(G);
for(a = 0; a < I->NLine; a++) for(a = 0; a < I->NLine; a++)
if(I->Sub[a]) { if(I->Sub[a]) {
Py_DECREF(I->Sub[a]); Py_DECREF(I->Sub[a]);
} }
PAutoUnblock(G, blocked); PAutoUnblock(G, blocked);
} }
#endif #endif
OrthoDetach(G, I->Block); OrthoDetach(G, I);
OrthoFreeBlock(G, I->Block);
FreeP(I->Sub); FreeP(I->Sub);
FreeP(I->Code); FreeP(I->Code);
FreeP(I->Command); FreeP(I->Command);
FreeP(I->Text); FreeP(I->Text);
OOFreeP(I); DeleteP(I);
} }
static void PopUpRecursiveFree(Block * block) static void PopUpRecursiveFree(Block * block)
{ {
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
if(I->Child) if(I->Child)
PopUpFree(I->Child); PopUpFree(I->Child);
skipping to change at line 414 skipping to change at line 414
static void PopUpFreeRecursiveChild(Block * block) static void PopUpFreeRecursiveChild(Block * block)
{ {
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) block->reference;
if(I->Child) if(I->Child)
PopUpFreeRecursiveChild(I->Child); PopUpFreeRecursiveChild(I->Child);
I->Child = NULL; I->Child = NULL;
PopUpFree(block); PopUpFree(block);
} }
/*========================================================================*/ /*========================================================================*/
int PopUpRelease(Block * block, int button, int x, int y, int mod) int CPopUp::release(int button, int x, int y, int mod)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) reference;
int gone_passive = false; int gone_passive = false;
int scroll_dy = 10; int scroll_dy = 10;
switch (button) { switch (button) {
case PYMOL_BUTTON_SCROLL_FORWARD: case PYMOL_BUTTON_SCROLL_FORWARD:
scroll_dy *= -1; scroll_dy *= -1;
case PYMOL_BUTTON_SCROLL_REVERSE: case PYMOL_BUTTON_SCROLL_REVERSE:
BlockTranslate(block, 0, scroll_dy); translate(0, scroll_dy);
return 1; return 1;
} }
if(I->NeverDragged) { if(I->NeverDragged) {
if(I->PassiveDelay > UtilGetSeconds(G)) { if(I->PassiveDelay > UtilGetSeconds(G)) {
gone_passive = true; gone_passive = true;
I->PassiveDelay = UtilGetSeconds(G); /* kill any further delay */ I->PassiveDelay = UtilGetSeconds(G); /* kill any further delay */
} }
} }
if(!gone_passive) { if(!gone_passive) {
if(!I->NeverDragged) if(!I->NeverDragged)
PopUpDrag(block, x, y, mod); drag(x, y, mod);
/* go passive if we click and release on a sub-menu */ /* go passive if we click and release on a sub-menu */
if((I->Selected >= 0) && (I->Sub[I->Selected])) { if((I->Selected >= 0) && (I->Sub[I->Selected])) {
if((x >= I->Block->rect.left) && (x <= I->Block->rect.right)) { if((x >= I->rect.left) && (x <= I->rect.right)) {
gone_passive = true; gone_passive = true;
} }
} }
} }
if(gone_passive) { if(gone_passive) {
PyMOL_SetPassive(G->PyMOL, true); PyMOL_SetPassive(G->PyMOL, true);
} else { } else {
OrthoUngrab(G); OrthoUngrab(G);
PopUpRecursiveDetach(block); PopUpRecursiveDetach(this);
if(!I->NeverDragged) if(!I->NeverDragged)
if((I->Selected >= 0) && (!I->Sub[I->Selected])) { if((I->Selected >= 0) && (!I->Sub[I->Selected])) {
PLog(G, I->Command[I->Selected], cPLog_pym); PLog(G, I->Command[I->Selected], cPLog_pym);
PParse(G, I->Command[I->Selected]); PParse(G, I->Command[I->Selected]);
PFlush(G); PFlush(G);
} }
PopUpRecursiveFree(block); PopUpRecursiveFree(this);
} }
OrthoDirty(G); OrthoDirty(G);
return (1); return (1);
} }
/*========================================================================*/ /*========================================================================*/
int PopUpDrag(Block * block, int x, int y, int mod) int CPopUp::drag(int x, int y, int mod)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = (CPopUp *) reference;
int a; int a;
int was = I->Selected; int was = I->Selected;
if((!I->NeverDragged) && (((I->StartX - x) > 4) || ((I->StartY - y) > 4))) if((!I->NeverDragged) && (((I->StartX - x) > 4) || ((I->StartY - y) > 4)))
I->NeverDragged = false; I->NeverDragged = false;
I->LastX = x; I->LastX = x;
I->LastY = y; I->LastY = y;
x -= I->Block->rect.left; x -= I->rect.left;
y = (I->Block->rect.top - cPopUpCharMargin) - y - 1; y = (I->rect.top - cPopUpCharMargin) - y - 1;
if((x < -2) || (x > (I->Width + 2))) { if((x < -2) || (x > (I->Width + 2))) {
int handled_flag = false; int handled_flag = false;
if(I->Child) { if(I->Child) {
if(PopUpRecursiveFind(I->Child, I->LastX, I->LastY) == I->Child) { if(PopUpRecursiveFind(I->Child, I->LastX, I->LastY) == I->Child) {
I->Selected = I->ChildLine; I->Selected = I->ChildLine;
handled_flag = true; handled_flag = true;
} }
} }
if(!handled_flag) { if(!handled_flag) {
if(I->Parent) { /* are we back in the parent window? */ if(I->Parent) { /* are we back in the parent window? */
I->Selected = -1; I->Selected = -1;
return PopUpDrag(I->Parent, I->LastX, I->LastY, mod); return I->Parent->drag(I->LastX, I->LastY, mod);
} else if(!I->Child) { } else if(!I->Child) {
I->Selected = -1; I->Selected = -1;
} }
} }
} else { } else {
OrthoGrab(G, block); OrthoGrab(G, this);
a = PopUpConvertY(I, y, false); a = PopUpConvertY(I, y, false);
if(I->NLine && (a == I->NLine)) if(I->NLine && (a == I->NLine))
if((y - a * cPopUpLineHeight) < 4) if((y - a * cPopUpLineHeight) < 4)
a = I->NLine - 1; a = I->NLine - 1;
if((a < 0) || (a >= I->NLine)) if((a < 0) || (a >= I->NLine))
I->Selected = -1; I->Selected = -1;
else { else {
if(I->Code[a] == 1) { if(I->Code[a] == 1) {
if((I->Child) && (I->ChildLine != a)) { if((I->Child) && (I->ChildLine != a)) {
if(I->ChildDelay < UtilGetSeconds(G)) { if(I->ChildDelay < UtilGetSeconds(G)) {
skipping to change at line 536 skipping to change at line 536
/* activate submenu */ /* activate submenu */
PyObject * sub_a = SubGetItem(G, I->Sub, a); PyObject * sub_a = SubGetItem(G, I->Sub, a);
if(!sub_a) { if(!sub_a) {
// do nothing // do nothing
} else if(!I->Child) { } else if(!I->Child) {
I->ChildLine = a; I->ChildLine = a;
if(I->ChildDelay > UtilGetSeconds(G)) { if(I->ChildDelay > UtilGetSeconds(G)) {
PyMOL_NeedFakeDrag(G->PyMOL); /* keep coming back here... */ PyMOL_NeedFakeDrag(G->PyMOL); /* keep coming back here... */
} else { } else {
I->Child = PopUpNew(G, I->LastX - 300, I->LastY, I->LastX, I->LastY, I->Child = PopUpNew(G, I->LastX - 300, I->LastY, I->LastX, I->LastY,
false, sub_a, I->Block); false, sub_a, I);
{ {
int target_y = int target_y =
block->rect.top - (PopUpConvertY(I, a, true) + cPopUpCharMargin) ; rect.top - (PopUpConvertY(I, a, true) + cPopUpCharMargin);
CPopUp *child = (CPopUp *) (I->Child->reference); CPopUp *child = (CPopUp *) (I->Child->reference);
if(child->NLine) if(child->NLine)
if(child->Code[0] != 1) if(child->Code[0] != 1)
target_y += cPopUpTitleHeight + 2; target_y += cPopUpTitleHeight + 2;
child->PlacementAffinity = PopPlaceChild(I->Child, block->rect.lef child->PlacementAffinity = PopPlaceChild(I->Child, rect.left - 5,
t - 5, rect.right + 5, target_y,
block->rect.right + 5, ta
rget_y,
I->PlacementAffinity); I->PlacementAffinity);
} }
OrthoGrab(G, I->Block); OrthoGrab(G, this);
I->ChildDelay = UtilGetSeconds(G) + cChildDelay; /* leave child u p for a while */ I->ChildDelay = UtilGetSeconds(G) + cChildDelay; /* leave child u p for a while */
} }
PyMOL_NeedFakeDrag(G->PyMOL); /* keep coming back here... */ PyMOL_NeedFakeDrag(G->PyMOL); /* keep coming back here... */
} else if(I->ChildLine == a) { /* on correct line */ } else if(I->ChildLine == a) { /* on correct line */
I->ChildDelay = UtilGetSeconds(G) + cChildDelay; /* keep child he re for a while */ I->ChildDelay = UtilGetSeconds(G) + cChildDelay; /* keep child he re for a while */
} }
I->Selected = a; I->Selected = a;
} }
} }
} }
skipping to change at line 593 skipping to change at line 593
} }
if(I->DirtyDelayFlag && (I->DirtyDelay < UtilGetSeconds(G))) { if(I->DirtyDelayFlag && (I->DirtyDelay < UtilGetSeconds(G))) {
I->DirtyDelayFlag = false; I->DirtyDelayFlag = false;
OrthoDirty(G); OrthoDirty(G);
OrthoInvalidateDoDraw(G); OrthoInvalidateDoDraw(G);
} }
return (1); return (1);
} }
/*========================================================================*/ /*========================================================================*/
void PopUpDraw(Block * block ORTHOCGOARG) void CPopUp::draw(CGO* orthoCGO)
{ {
CPopUp *I = (CPopUp *) block->reference; CPopUp *I = this; // TODO: Remove I during PopUp refactor
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
int x, y, a, xx; int x, y, a, xx;
char *c; char *c;
if(G->HaveGUI && G->ValidContext) { if(G->HaveGUI && G->ValidContext) {
if((I->Child) && (I->Selected != I->ChildLine)) if((I->Child) && (I->Selected != I->ChildLine))
PyMOL_NeedFakeDrag(G->PyMOL); PyMOL_NeedFakeDrag(G->PyMOL);
/* put raised border around pop-up menu */ /* put raised border around pop-up menu */
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.2F, 0.2F, 0.4F); CGOColor(orthoCGO, 0.2F, 0.2F, 0.4F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.bottom - 2, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.bottom - 2, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.bottom - 2, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.bottom - 2, 0.f);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.bottom + 1, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.bottom + 1, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.bottom + 1, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.bottom + 1, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.2F, 0.2F, 0.4F); glColor3f(0.2F, 0.2F, 0.4F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 2, block->rect.bottom - 2); glVertex2i(rect.left - 2, rect.bottom - 2);
glVertex2i(block->rect.right + 2, block->rect.bottom - 2); glVertex2i(rect.right + 2, rect.bottom - 2);
glVertex2i(block->rect.right + 2, block->rect.bottom + 1); glVertex2i(rect.right + 2, rect.bottom + 1);
glVertex2i(block->rect.left - 2, block->rect.bottom + 1); glVertex2i(rect.left - 2, rect.bottom + 1);
glEnd(); glEnd();
} }
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.4F, 0.4F, 0.6F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.6F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.bottom + 1, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.bottom + 1, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.bottom + 1, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.bottom + 1, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.4F, 0.4F, 0.6F); glColor3f(0.4F, 0.4F, 0.6F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 1, block->rect.bottom - 1); glVertex2i(rect.left - 1, rect.bottom - 1);
glVertex2i(block->rect.right + 1, block->rect.bottom - 1); glVertex2i(rect.right + 1, rect.bottom - 1);
glVertex2i(block->rect.right + 1, block->rect.bottom + 1); glVertex2i(rect.right + 1, rect.bottom + 1);
glVertex2i(block->rect.left - 1, block->rect.bottom + 1); glVertex2i(rect.left - 1, rect.bottom + 1);
glEnd(); glEnd();
} }
/* right */ /* right */
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.2F, 0.2F, 0.4F); CGOColor(orthoCGO, 0.2F, 0.2F, 0.4F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.right, block->rect.bottom - 2, 0.f); CGOVertex(orthoCGO, rect.right, rect.bottom - 2, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.bottom - 2, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.bottom - 2, 0.f);
CGOVertex(orthoCGO, block->rect.right, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.2F, 0.2F, 0.4F); glColor3f(0.2F, 0.2F, 0.4F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.right, block->rect.bottom - 2); glVertex2i(rect.right, rect.bottom - 2);
glVertex2i(block->rect.right + 2, block->rect.bottom - 2); glVertex2i(rect.right + 2, rect.bottom - 2);
glVertex2i(block->rect.right + 2, block->rect.top); glVertex2i(rect.right + 2, rect.top);
glVertex2i(block->rect.right, block->rect.top); glVertex2i(rect.right, rect.top);
glEnd(); glEnd();
} }
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.4F, 0.4F, 0.6F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.6F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.right, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.right, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.right, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.4F, 0.4F, 0.6F); glColor3f(0.4F, 0.4F, 0.6F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.right, block->rect.bottom - 1); glVertex2i(rect.right, rect.bottom - 1);
glVertex2i(block->rect.right + 1, block->rect.bottom - 1); glVertex2i(rect.right + 1, rect.bottom - 1);
glVertex2i(block->rect.right + 1, block->rect.top); glVertex2i(rect.right + 1, rect.top);
glVertex2i(block->rect.right, block->rect.top); glVertex2i(rect.right, rect.top);
glEnd(); glEnd();
} }
/* top */ /* top */
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.5F, 0.5F, 0.7F); CGOColor(orthoCGO, 0.5F, 0.5F, 0.7F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.top + 2, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.top + 2, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.top + 2, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.top + 2, 0.f);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.right + 2, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right + 2, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.5F, 0.5F, 0.7F); glColor3f(0.5F, 0.5F, 0.7F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 2, block->rect.top + 2); glVertex2i(rect.left - 2, rect.top + 2);
glVertex2i(block->rect.right + 2, block->rect.top + 2); glVertex2i(rect.right + 2, rect.top + 2);
glVertex2i(block->rect.right + 2, block->rect.top); glVertex2i(rect.right + 2, rect.top);
glVertex2i(block->rect.left - 2, block->rect.top); glVertex2i(rect.left - 2, rect.top);
glEnd(); glEnd();
} }
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F); CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.top + 1, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.top + 1, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.top + 1, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.top + 1, 0.f);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.right + 1, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.right + 1, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.6F, 0.6F, 0.8F); glColor3f(0.6F, 0.6F, 0.8F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 1, block->rect.top + 1); glVertex2i(rect.left - 1, rect.top + 1);
glVertex2i(block->rect.right + 1, block->rect.top + 1); glVertex2i(rect.right + 1, rect.top + 1);
glVertex2i(block->rect.right + 1, block->rect.top); glVertex2i(rect.right + 1, rect.top);
glVertex2i(block->rect.left - 1, block->rect.top); glVertex2i(rect.left - 1, rect.top);
glEnd(); glEnd();
} }
/* left */ /* left */
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.5F, 0.5F, 0.7F); CGOColor(orthoCGO, 0.5F, 0.5F, 0.7F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.bottom - 2, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.bottom - 2, 0.f);
CGOVertex(orthoCGO, block->rect.left, block->rect.bottom, 0.f); CGOVertex(orthoCGO, rect.left, rect.bottom, 0.f);
CGOVertex(orthoCGO, block->rect.left - 2, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left - 2, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.left, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.5F, 0.5F, 0.7F); glColor3f(0.5F, 0.5F, 0.7F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 2, block->rect.bottom - 2); glVertex2i(rect.left - 2, rect.bottom - 2);
glVertex2i(block->rect.left, block->rect.bottom); glVertex2i(rect.left, rect.bottom);
glVertex2i(block->rect.left, block->rect.top); glVertex2i(rect.left, rect.top);
glVertex2i(block->rect.left - 2, block->rect.top); glVertex2i(rect.left - 2, rect.top);
glEnd(); glEnd();
} }
if (orthoCGO){ if (orthoCGO){
CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F); CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.left, block->rect.bottom - 1, 0.f); CGOVertex(orthoCGO, rect.left, rect.bottom - 1, 0.f);
CGOVertex(orthoCGO, block->rect.left, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left, rect.top, 0.f);
CGOVertex(orthoCGO, block->rect.left - 1, block->rect.top, 0.f); CGOVertex(orthoCGO, rect.left - 1, rect.top, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.6F, 0.6F, 0.8F); glColor3f(0.6F, 0.6F, 0.8F);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2i(block->rect.left - 1, block->rect.bottom - 1); glVertex2i(rect.left - 1, rect.bottom - 1);
glVertex2i(block->rect.left, block->rect.bottom - 1); glVertex2i(rect.left, rect.bottom - 1);
glVertex2i(block->rect.left, block->rect.top); glVertex2i(rect.left, rect.top);
glVertex2i(block->rect.left - 1, block->rect.top); glVertex2i(rect.left - 1, rect.top);
glEnd(); glEnd();
} }
if (orthoCGO) if (orthoCGO)
CGOColorv(orthoCGO, block->BackColor); CGOColorv(orthoCGO, BackColor);
#ifndef PURE_OPENGL_ES_2
else else
glColor3fv(block->BackColor); glColor3fv(BackColor);
#endif
BlockFill(block ORTHOCGOARGVAR); fill(orthoCGO);
if (orthoCGO) if (orthoCGO)
CGOColorv(orthoCGO, block->TextColor); CGOColorv(orthoCGO, TextColor);
#ifndef PURE_OPENGL_ES_2
else else
glColor3fv(block->TextColor); glColor3fv(TextColor);
#endif
if(I->Selected >= 0) { if(I->Selected >= 0) {
x = I->Block->rect.left; x = rect.left;
y = I->Block->rect.top - PopUpConvertY(I, I->Selected, true) - cPopUpCharM y = rect.top - PopUpConvertY(I, I->Selected, true) - cPopUpCharMargin;
argin;
y += 2; y += 2;
if (orthoCGO){ if (orthoCGO){
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, x, y, 0.f); CGOVertex(orthoCGO, x, y, 0.f);
CGOVertex(orthoCGO, x + I->Width - 1, y, 0.f); CGOVertex(orthoCGO, x + I->Width - 1, y, 0.f);
CGOVertex(orthoCGO, x, y - (cPopUpLineHeight + 3), 0.f); CGOVertex(orthoCGO, x, y - (cPopUpLineHeight + 3), 0.f);
CGOVertex(orthoCGO, x + I->Width - 1, y - (cPopUpLineHeight + 3), 0.f); CGOVertex(orthoCGO, x + I->Width - 1, y - (cPopUpLineHeight + 3), 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
skipping to change at line 801 skipping to change at line 804
if (orthoCGO) if (orthoCGO)
CGOColor(orthoCGO, 0.3F, 0.3F, 0.6F); CGOColor(orthoCGO, 0.3F, 0.3F, 0.6F);
else else
glColor3f(0.3F, 0.3F, 0.6F); glColor3f(0.3F, 0.3F, 0.6F);
} else { } else {
if (orthoCGO) if (orthoCGO)
CGOColor(orthoCGO, 1.0F, 1.0F, 1.0F); CGOColor(orthoCGO, 1.0F, 1.0F, 1.0F);
else else
glColor3f(1.0F, 1.0F, 1.0F); glColor3f(1.0F, 1.0F, 1.0F);
} }
x = I->Block->rect.left; x = rect.left;
y = I->Block->rect.top; y = rect.top;
if (orthoCGO){ if (orthoCGO){
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, x, y, 0.f); CGOVertex(orthoCGO, x, y, 0.f);
CGOVertex(orthoCGO, x + I->Width, y, 0.f); CGOVertex(orthoCGO, x + I->Width, y, 0.f);
CGOVertex(orthoCGO, x, y - (cPopUpLineHeight + cPopUpCharMargin), 0.f); CGOVertex(orthoCGO, x, y - (cPopUpLineHeight + cPopUpCharMargin), 0.f);
CGOVertex(orthoCGO, x + I->Width, y - (cPopUpLineHeight + cPopUpCharMargi n), 0.f); CGOVertex(orthoCGO, x + I->Width, y - (cPopUpLineHeight + cPopUpCharMargi n), 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
skipping to change at line 837 skipping to change at line 840
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glColor3f(0.2F, 0.2F, 0.4F); glColor3f(0.2F, 0.2F, 0.4F);
glBegin(GL_LINES); glBegin(GL_LINES);
glVertex2i(x + I->Width - 1, y - (cPopUpLineHeight + cPopUpCharMargin)); glVertex2i(x + I->Width - 1, y - (cPopUpLineHeight + cPopUpCharMargin));
glVertex2i(x, y - (cPopUpLineHeight + cPopUpCharMargin)); glVertex2i(x, y - (cPopUpLineHeight + cPopUpCharMargin));
glEnd(); glEnd();
} }
} }
x = I->Block->rect.left + cPopUpCharMargin; x = rect.left + cPopUpCharMargin;
y = (I->Block->rect.top - cPopUpLineHeight) - cPopUpCharMargin + 2; y = (rect.top - cPopUpLineHeight) - cPopUpCharMargin + 2;
for(a = 0; a < I->NLine; a++) { for(a = 0; a < I->NLine; a++) {
auto text_color = (a == I->Selected) ? I->Block->BackColor : I->Block->Tex tColor; auto text_color = (a == I->Selected) ? BackColor : TextColor;
TextSetColor(G, text_color); TextSetColor(G, text_color);
if(I->Code[a]) { if(I->Code[a]) {
c = I->Text[a]; c = I->Text[a];
xx = x; xx = x;
while(*c) { while(*c) {
// note: previously also supported "\\+++red", but was never used // note: previously also supported "\\+++red", but was never used
if(TextSetColorFromCode(G, c, text_color)) { if(TextSetColorFromCode(G, c, text_color)) {
c += 4; c += 4;
} }
TextSetPos2i(G, xx, y + cPopUpCharLift); TextSetPos2i(G, xx, y + cPopUpCharLift);
TextDrawChar(G, *(c++) ORTHOCGOARGVAR); TextDrawChar(G, *(c++) ORTHOCGOARGVAR);
xx = xx + DIP2PIXEL(8); xx = xx + DIP2PIXEL(8);
} }
if(I->Sub[a]) { if(I->Sub[a]) {
if (orthoCGO){ if (orthoCGO){
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F);
CGOVertex(orthoCGO, I->Block->rect.left - 3, y + ((cPopUpLineHeight)) - 4, 0.f); CGOVertex(orthoCGO, rect.left - 3, y + ((cPopUpLineHeight)) - 4, 0.f) ;
CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F);
CGOVertex(orthoCGO, I->Block->rect.left - 3, y + 1, 0.f); CGOVertex(orthoCGO, rect.left - 3, y + 1, 0.f);
CGOColor(orthoCGO, 0.1F, 0.1F, 0.1F); CGOColor(orthoCGO, 0.1F, 0.1F, 0.1F);
CGOVertex(orthoCGO, I->Block->rect.left, y + ((cPopUpLineHeight)) - 4 , 0.f); CGOVertex(orthoCGO, rect.left, y + ((cPopUpLineHeight)) - 4, 0.f);
CGOColor(orthoCGO, 0.1F, 0.1F, 0.1F); CGOColor(orthoCGO, 0.1F, 0.1F, 0.1F);
CGOVertex(orthoCGO, I->Block->rect.left, y + 1, 0.f); CGOVertex(orthoCGO, rect.left, y + 1, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glColor3f(0.4F, 0.4F, 0.4F); glColor3f(0.4F, 0.4F, 0.4F);
glVertex2i(I->Block->rect.left - 3, y + 1); glVertex2i(rect.left - 3, y + 1);
glColor3f(0.1F, 0.1F, 0.1F); glColor3f(0.1F, 0.1F, 0.1F);
glVertex2i(I->Block->rect.left, y + 1); glVertex2i(rect.left, y + 1);
glVertex2i(I->Block->rect.left, y + ((cPopUpLineHeight)) - 4); glVertex2i(rect.left, y + ((cPopUpLineHeight)) - 4);
glColor3f(0.4F, 0.4F, 0.4F); glColor3f(0.4F, 0.4F, 0.4F);
glVertex2i(I->Block->rect.left - 3, y + ((cPopUpLineHeight)) - 4); glVertex2i(rect.left - 3, y + ((cPopUpLineHeight)) - 4);
glEnd(); glEnd();
} }
if (orthoCGO){ if (orthoCGO){
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOColor(orthoCGO, 0.1F, 0.2F, 0.2F); CGOColor(orthoCGO, 0.1F, 0.2F, 0.2F);
CGOVertex(orthoCGO, I->Block->rect.right, y + 1, 0.f); CGOVertex(orthoCGO, rect.right, y + 1, 0.f);
CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F);
CGOVertex(orthoCGO, I->Block->rect.right + 3, y + 1, 0.f); CGOVertex(orthoCGO, rect.right + 3, y + 1, 0.f);
CGOColor(orthoCGO, 0.1F, 0.2F, 0.2F); CGOColor(orthoCGO, 0.1F, 0.2F, 0.2F);
CGOVertex(orthoCGO, I->Block->rect.right, y + ((cPopUpLineHeight)) - 4, 0.f); CGOVertex(orthoCGO, rect.right, y + ((cPopUpLineHeight)) - 4, 0.f);
CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F); CGOColor(orthoCGO, 0.4F, 0.4F, 0.4F);
CGOVertex(orthoCGO, I->Block->rect.right + 3, y + ((cPopUpLineHeight) ) - 4, 0.f); CGOVertex(orthoCGO, rect.right + 3, y + ((cPopUpLineHeight)) - 4, 0.f );
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glColor3f(0.1F, 0.2F, 0.2F); glColor3f(0.1F, 0.2F, 0.2F);
glVertex2i(I->Block->rect.right, y + 1); glVertex2i(rect.right, y + 1);
glColor3f(0.4F, 0.4F, 0.4F); glColor3f(0.4F, 0.4F, 0.4F);
glVertex2i(I->Block->rect.right + 3, y + 1); glVertex2i(rect.right + 3, y + 1);
glVertex2i(I->Block->rect.right + 3, y + ((cPopUpLineHeight)) - 4); glVertex2i(rect.right + 3, y + ((cPopUpLineHeight)) - 4);
glColor3f(0.1F, 0.2F, 0.2F); glColor3f(0.1F, 0.2F, 0.2F);
glVertex2i(I->Block->rect.right, y + ((cPopUpLineHeight)) - 4); glVertex2i(rect.right, y + ((cPopUpLineHeight)) - 4);
glEnd(); glEnd();
} }
} }
y -= cPopUpLineHeight; y -= cPopUpLineHeight;
if(I->Code[a] == 2) if(I->Code[a] == 2)
y -= 2; y -= 2;
} else { } else {
if (orthoCGO){ if (orthoCGO){
/* two lines between sections in the menu, one light, one dark */ /* two lines between sections in the menu, one light, one dark */
CGOColor(orthoCGO, 0.3F, 0.3F, 0.5F); CGOColor(orthoCGO, 0.3F, 0.3F, 0.5F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, I->Block->rect.right, CGOVertex(orthoCGO, rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f);
CGOVertex(orthoCGO, I->Block->rect.right, CGOVertex(orthoCGO, rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3, 0.f);
CGOVertex(orthoCGO, I->Block->rect.left, CGOVertex(orthoCGO, rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f);
CGOVertex(orthoCGO, I->Block->rect.left, CGOVertex(orthoCGO, rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F); CGOColor(orthoCGO, 0.6F, 0.6F, 0.8F);
CGOBegin(orthoCGO, GL_TRIANGLE_STRIP); CGOBegin(orthoCGO, GL_TRIANGLE_STRIP);
CGOVertex(orthoCGO, I->Block->rect.right, CGOVertex(orthoCGO, rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 5, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 5, 0.f);
CGOVertex(orthoCGO, I->Block->rect.right, CGOVertex(orthoCGO, rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f);
CGOVertex(orthoCGO, I->Block->rect.left, CGOVertex(orthoCGO, rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 5, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 5, 0.f);
CGOVertex(orthoCGO, I->Block->rect.left, CGOVertex(orthoCGO, rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4, 0.f);
CGOEnd(orthoCGO); CGOEnd(orthoCGO);
} else { } else {
glBegin(GL_LINES); glBegin(GL_LINES);
glColor3f(0.3F, 0.3F, 0.5F); glColor3f(0.3F, 0.3F, 0.5F);
glVertex2i(I->Block->rect.left, glVertex2i(rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3);
glVertex2i(I->Block->rect.right, glVertex2i(rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 3);
glColor3f(0.6F, 0.6F, 0.8F); glColor3f(0.6F, 0.6F, 0.8F);
glVertex2i(I->Block->rect.left, glVertex2i(rect.left,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4);
glVertex2i(I->Block->rect.right, glVertex2i(rect.right,
y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4); y + ((cPopUpLineHeight + cPopUpCharMargin) / 2) + 4);
glEnd(); glEnd();
} }
y -= cPopUpBarHeight; y -= cPopUpBarHeight;
} }
} }
if (orthoCGO) if (orthoCGO)
CGOColorv(orthoCGO, block->TextColor); CGOColorv(orthoCGO, TextColor);
#ifndef PURE_OPENGL_ES_2
else else
glColor3fv(block->TextColor); glColor3fv(TextColor);
#endif
/* BlockOutline(block); */ /* BlockOutline(block); */
} }
} }
 End of changes. 84 change blocks. 
195 lines changed or deleted 197 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)