Wizard.cpp (pymol-v1.8.6.0.tar.bz2) | : | Wizard.cpp (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 76 | skipping to change at line 76 | |||
ov_diff Stack; | ov_diff Stack; | |||
int Pressed; | int Pressed; | |||
int EventMask; | int EventMask; | |||
int Dirty; | int Dirty; | |||
int LastUpdatedState; | int LastUpdatedState; | |||
int LastUpdatedFrame; | int LastUpdatedFrame; | |||
float LastUpdatedPosition[3]; | float LastUpdatedPosition[3]; | |||
SceneViewType LastUpdatedView; | SceneViewType LastUpdatedView; | |||
}; | }; | |||
#define cWizardLeftMargin 2 | #define cWizardLeftMargin DIP2PIXEL(3) | |||
#define cWizardTopMargin 0 | #define cWizardTopMargin 0 | |||
#define cWizardClickOffset 2 | #define cWizardClickOffset DIP2PIXEL(2) | |||
void WizardDirty(PyMOLGlobals * G) | void WizardDirty(PyMOLGlobals * G) | |||
{ | { | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
I->Dirty = true; | I->Dirty = true; | |||
OrthoDirty(G); | OrthoDirty(G); | |||
} | } | |||
int WizardUpdate(PyMOLGlobals * G) | int WizardUpdate(PyMOLGlobals * G) | |||
{ | { | |||
skipping to change at line 246 | skipping to change at line 246 | |||
I->Line[a].code, sizeof(OrthoLineType ) - 1); | I->Line[a].code, sizeof(OrthoLineType ) - 1); | |||
} | } | |||
} | } | |||
I->NLine = ll; | I->NLine = ll; | |||
} | } | |||
} | } | |||
Py_XDECREF(P_list); | Py_XDECREF(P_list); | |||
} | } | |||
} | } | |||
if(I->NLine) { | if(I->NLine) { | |||
int LineHeight = SettingGetGlobal_i(G, cSetting_internal_gui_control_size); | int LineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_contr ol_size)); | |||
OrthoReshapeWizard(G, LineHeight * I->NLine + 4); | OrthoReshapeWizard(G, LineHeight * I->NLine + 4); | |||
} else { | } else { | |||
OrthoReshapeWizard(G, 0); | OrthoReshapeWizard(G, 0); | |||
} | } | |||
PAutoUnblock(G, blocked); | PAutoUnblock(G, blocked); | |||
#endif | #endif | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void WizardSet(PyMOLGlobals * G, PyObject * wiz, int replace) | void WizardSet(PyMOLGlobals * G, PyObject * wiz, int replace) | |||
skipping to change at line 605 | skipping to change at line 605 | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static int WizardClick(Block * block, int button, int x, int y, int mod) | static int WizardClick(Block * block, int button, int x, int y, int mod) | |||
{ | { | |||
#ifdef _PYMOL_NOPY | #ifdef _PYMOL_NOPY | |||
return 0; | return 0; | |||
#else | #else | |||
PyMOLGlobals *G = block->G; | PyMOLGlobals *G = block->G; | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
int a; | int a; | |||
PyObject *menuList = NULL; | PyObject *menuList = NULL; | |||
int LineHeight = SettingGetGlobal_i(G, cSetting_internal_gui_control_size); | int LineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_control _size)); | |||
a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | |||
if((a >= 0) && ((ov_size) a < I->NLine)) { | if((a >= 0) && ((ov_size) a < I->NLine)) { | |||
switch (I->Line[a].type) { | switch (I->Line[a].type) { | |||
case cWizTypeButton: | case cWizTypeButton: | |||
OrthoGrab(G, I->Block); | OrthoGrab(G, I->Block); | |||
I->Pressed = (int) a; | I->Pressed = (int) a; | |||
OrthoDirty(G); | OrthoDirty(G); | |||
break; | break; | |||
case cWizTypePopUp: | case cWizTypePopUp: | |||
skipping to change at line 653 | skipping to change at line 653 | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static int WizardDrag(Block * block, int x, int y, int mod) | static int WizardDrag(Block * block, int x, int y, int mod) | |||
{ | { | |||
#ifdef _PYMOL_NOPY | #ifdef _PYMOL_NOPY | |||
return 0; | return 0; | |||
#else | #else | |||
PyMOLGlobals *G = block->G; | PyMOLGlobals *G = block->G; | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
int LineHeight = SettingGetGlobal_i(G, cSetting_internal_gui_control_size); | int LineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_control _size)); | |||
int a; | int a; | |||
a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | |||
if((x < I->Block->rect.left) || (x > I->Block->rect.right)) | if((x < I->Block->rect.left) || (x > I->Block->rect.right)) | |||
a = -1; | a = -1; | |||
if(I->Pressed != a) { | if(I->Pressed != a) { | |||
I->Pressed = -1; | I->Pressed = -1; | |||
OrthoDirty(G); | OrthoDirty(G); | |||
skipping to change at line 686 | skipping to change at line 686 | |||
return (1); | return (1); | |||
#endif | #endif | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static int WizardRelease(Block * block, int button, int x, int y, int mod) | static int WizardRelease(Block * block, int button, int x, int y, int mod) | |||
{ | { | |||
PyMOLGlobals *G = block->G; | PyMOLGlobals *G = block->G; | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
int LineHeight = SettingGetGlobal_i(G, cSetting_internal_gui_control_size); | int LineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_control _size)); | |||
int a; | int a; | |||
a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | a = ((I->Block->rect.top - (y + cWizardClickOffset)) - cWizardTopMargin) / Lin eHeight; | |||
if(I->Pressed) | if(I->Pressed) | |||
I->Pressed = -1; | I->Pressed = -1; | |||
OrthoDirty(G); | OrthoDirty(G); | |||
OrthoUngrab(G); | OrthoUngrab(G); | |||
skipping to change at line 817 | skipping to change at line 817 | |||
TextSetColor(G, color); | TextSetColor(G, color); | |||
c += 4; | c += 4; | |||
} else { | } else { | |||
TextSetColor3f(G, (*(c + 1) - '0') / 9.0F, (*(c + 2) - '0') / 9.0F , | TextSetColor3f(G, (*(c + 1) - '0') / 9.0F, (*(c + 2) - '0') / 9.0F , | |||
(*(c + 3) - '0') / 9.0F); | (*(c + 3) - '0') / 9.0F); | |||
c += 4; | c += 4; | |||
} | } | |||
} | } | |||
TextSetPos2i(G, xx, yy); | TextSetPos2i(G, xx, yy); | |||
TextDrawChar(G, *(c++) ORTHOCGOARGVAR); | TextDrawChar(G, *(c++) ORTHOCGOARGVAR); | |||
xx = xx + 8; | xx = xx + DIP2PIXEL(8); | |||
} | } | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static void WizardDraw(Block * block ORTHOCGOARG) | static void WizardDraw(Block * block ORTHOCGOARG) | |||
{ | { | |||
PyMOLGlobals *G = block->G; | PyMOLGlobals *G = block->G; | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
int x, y; | int x, y; | |||
skipping to change at line 844 | skipping to change at line 844 | |||
float dimLightEdge[3] = { 0.6F, 0.6F, 0.6F }; | float dimLightEdge[3] = { 0.6F, 0.6F, 0.6F }; | |||
float dimDarkEdge[3] = { 0.25F, 0.25F, 0.25F }; | float dimDarkEdge[3] = { 0.25F, 0.25F, 0.25F }; | |||
float menuBGColor[3] = { 0.5F, 0.5F, 1.0 }; | float menuBGColor[3] = { 0.5F, 0.5F, 1.0 }; | |||
float menuLightEdge[3] = { 0.7F, 0.7F, 0.9F }; | float menuLightEdge[3] = { 0.7F, 0.7F, 0.9F }; | |||
float menuDarkEdge[3] = { 0.3F, 0.3F, 0.5F }; | float menuDarkEdge[3] = { 0.3F, 0.3F, 0.5F }; | |||
float black_color[3] = { 0.0F, 0.0F, 0.0F }; | float black_color[3] = { 0.0F, 0.0F, 0.0F }; | |||
float menuColor[3] = { 0.0, 0.0, 0.0 }; | float menuColor[3] = { 0.0, 0.0, 0.0 }; | |||
int LineHeight = SettingGetGlobal_i(G, cSetting_internal_gui_control_size); | int LineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_control | |||
int text_lift = (LineHeight / 2) - 5; | _size)); | |||
int text_lift = (LineHeight / 2) - DIP2PIXEL(5); | ||||
float *text_color, *text_color2 = I->Block->TextColor; | float *text_color, *text_color2 = I->Block->TextColor; | |||
text_color = menuColor; | text_color = menuColor; | |||
if(G->HaveGUI && G->ValidContext && ((block->rect.right - block->rect.left) > 6)) { | if(G->HaveGUI && G->ValidContext && ((block->rect.right - block->rect.left) > 6)) { | |||
if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 0) { | if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 0) { | |||
if (orthoCGO) | if (orthoCGO) | |||
CGOColorv(orthoCGO, I->Block->BackColor); | CGOColorv(orthoCGO, I->Block->BackColor); | |||
else | else | |||
skipping to change at line 908 | skipping to change at line 908 | |||
draw_button(I->Block->rect.left + 1, y, | draw_button(I->Block->rect.left + 1, y, | |||
(I->Block->rect.right - I->Block->rect.left) - 1, | (I->Block->rect.right - I->Block->rect.left) - 1, | |||
LineHeight - 1, menuLightEdge, menuDarkEdge, menuBGColor O RTHOCGOARGVAR); | LineHeight - 1, menuLightEdge, menuDarkEdge, menuBGColor O RTHOCGOARGVAR); | |||
/* glColor3fv(menuColor); */ | /* glColor3fv(menuColor); */ | |||
text_color = menuColor; | text_color = menuColor; | |||
break; | break; | |||
default: | default: | |||
break; | break; | |||
} | } | |||
} | } | |||
draw_text(G, I->Line[a].text, x + 1, y + text_lift, text_color ORTHOCGOARG VAR); | draw_text(G, I->Line[a].text, x, y + text_lift, text_color ORTHOCGOARGVAR) ; | |||
/*GrapDrawStr(I->Line[a].text,x+1,y+text_lift); */ | /*GrapDrawStr(I->Line[a].text,x+1,y+text_lift); */ | |||
y -= LineHeight; | y -= LineHeight; | |||
} | } | |||
} | } | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
PyObject *WizardGet(PyMOLGlobals * G) | PyObject *WizardGet(PyMOLGlobals * G) | |||
{ | { | |||
CWizard *I = G->Wizard; | CWizard *I = G->Wizard; | |||
End of changes. 9 change blocks. | ||||
10 lines changed or deleted | 11 lines changed or added |