* Taseditor: fixed known WinXP bug with scrollbar arrows
* Taseditor: 2x faster scrolling * Taseditor: branch description text size = size of edit fields * Taseditor: observing Piano Roll with right button
This commit is contained in:
parent
1e98a31332
commit
1eadc6f533
|
@ -839,6 +839,7 @@ void BOOKMARKS::RedrawBranchesTree()
|
||||||
BitBlt(hBitmapDC, branch_x, branch_y, DIGIT_BITMAP_WIDTH, DIGIT_BITMAP_HEIGHT, hSpritesheetDC, i * DIGIT_BITMAP_WIDTH, 0, SRCCOPY);
|
BitBlt(hBitmapDC, branch_x, branch_y, DIGIT_BITMAP_WIDTH, DIGIT_BITMAP_HEIGHT, hSpritesheetDC, i * DIGIT_BITMAP_WIDTH, 0, SRCCOPY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SetBkMode(hBitmapDC, TRANSPARENT);
|
||||||
// jump_frame of item under cursor (except cloud - it doesn't have particular frame)
|
// jump_frame of item under cursor (except cloud - it doesn't have particular frame)
|
||||||
if (item_under_mouse > ITEM_UNDER_MOUSE_CLOUD)
|
if (item_under_mouse > ITEM_UNDER_MOUSE_CLOUD)
|
||||||
{
|
{
|
||||||
|
@ -847,18 +848,35 @@ void BOOKMARKS::RedrawBranchesTree()
|
||||||
U32ToDecStr(framenum_string, bookmarks_array[item_under_mouse].snapshot.jump_frame, DIGITS_IN_FRAMENUM);
|
U32ToDecStr(framenum_string, bookmarks_array[item_under_mouse].snapshot.jump_frame, DIGITS_IN_FRAMENUM);
|
||||||
else
|
else
|
||||||
U32ToDecStr(framenum_string, currFrameCounter, DIGITS_IN_FRAMENUM);
|
U32ToDecStr(framenum_string, currFrameCounter, DIGITS_IN_FRAMENUM);
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_SHADOW_COLOR);
|
||||||
|
TextOut(hBitmapDC, BRANCHES_BITMAP_FRAMENUM_X + 1, BRANCHES_BITMAP_FRAMENUM_Y + 1, (LPCSTR)framenum_string, DIGITS_IN_FRAMENUM);
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_COLOR);
|
||||||
TextOut(hBitmapDC, BRANCHES_BITMAP_FRAMENUM_X, BRANCHES_BITMAP_FRAMENUM_Y, (LPCSTR)framenum_string, DIGITS_IN_FRAMENUM);
|
TextOut(hBitmapDC, BRANCHES_BITMAP_FRAMENUM_X, BRANCHES_BITMAP_FRAMENUM_Y, (LPCSTR)framenum_string, DIGITS_IN_FRAMENUM);
|
||||||
}
|
}
|
||||||
// time of item under cursor
|
// time of item under cursor
|
||||||
if (item_under_mouse > ITEM_UNDER_MOUSE_NONE)
|
if (item_under_mouse > ITEM_UNDER_MOUSE_NONE)
|
||||||
{
|
{
|
||||||
if (item_under_mouse == ITEM_UNDER_MOUSE_CLOUD)
|
if (item_under_mouse == ITEM_UNDER_MOUSE_CLOUD)
|
||||||
|
{
|
||||||
|
// draw shadow of text
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_SHADOW_COLOR);
|
||||||
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X + 1, BRANCHES_BITMAP_TIME_Y + 1, (LPCSTR)cloud_time, TIME_DESC_LENGTH-1);
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_COLOR);
|
||||||
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)cloud_time, TIME_DESC_LENGTH-1);
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)cloud_time, TIME_DESC_LENGTH-1);
|
||||||
else if (item_under_mouse < TOTAL_BOOKMARKS)
|
} else if (item_under_mouse < TOTAL_BOOKMARKS)
|
||||||
|
{
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_SHADOW_COLOR);
|
||||||
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X + 1, BRANCHES_BITMAP_TIME_Y + 1, (LPCSTR)bookmarks_array[item_under_mouse].snapshot.description, TIME_DESC_LENGTH-1);
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_COLOR);
|
||||||
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)bookmarks_array[item_under_mouse].snapshot.description, TIME_DESC_LENGTH-1);
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)bookmarks_array[item_under_mouse].snapshot.description, TIME_DESC_LENGTH-1);
|
||||||
else
|
} else // fireball - current_pos_time
|
||||||
|
{
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_SHADOW_COLOR);
|
||||||
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X + 1, BRANCHES_BITMAP_TIME_Y + 1, (LPCSTR)current_pos_time, TIME_DESC_LENGTH-1);
|
||||||
|
SetTextColor(hBitmapDC, BRANCHES_TEXT_COLOR);
|
||||||
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)current_pos_time, TIME_DESC_LENGTH-1);
|
TextOut(hBitmapDC, BRANCHES_BITMAP_TIME_X, BRANCHES_BITMAP_TIME_Y, (LPCSTR)current_pos_time, TIME_DESC_LENGTH-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// finished
|
// finished
|
||||||
must_redraw_branches_tree = false;
|
must_redraw_branches_tree = false;
|
||||||
InvalidateRect(hwndBranchesBitmap, 0, FALSE);
|
InvalidateRect(hwndBranchesBitmap, 0, FALSE);
|
||||||
|
@ -931,11 +949,11 @@ void BOOKMARKS::CheckMousePos()
|
||||||
// find item under mouse
|
// find item under mouse
|
||||||
item_under_mouse = ITEM_UNDER_MOUSE_NONE;
|
item_under_mouse = ITEM_UNDER_MOUSE_NONE;
|
||||||
for (int i = 0; i < TOTAL_BOOKMARKS; ++i)
|
for (int i = 0; i < TOTAL_BOOKMARKS; ++i)
|
||||||
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && mouse_x >= BranchCurrX[i] - DIGIT_RECT_HALFWIDTH && mouse_x < BranchCurrX[i] - DIGIT_RECT_HALFWIDTH + DIGIT_RECT_WIDTH && mouse_y >= BranchCurrY[i] - DIGIT_RECT_HALFHEIGHT && mouse_y < BranchCurrY[i] - DIGIT_RECT_HALFHEIGHT + DIGIT_RECT_HEIGHT)
|
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && mouse_x >= BranchCurrX[i] - DIGIT_RECT_HALFWIDTH_COLLISION && mouse_x < BranchCurrX[i] - DIGIT_RECT_HALFWIDTH_COLLISION + DIGIT_RECT_WIDTH_COLLISION && mouse_y >= BranchCurrY[i] - DIGIT_RECT_HALFHEIGHT_COLLISION && mouse_y < BranchCurrY[i] - DIGIT_RECT_HALFHEIGHT_COLLISION + DIGIT_RECT_HEIGHT_COLLISION)
|
||||||
item_under_mouse = i;
|
item_under_mouse = i;
|
||||||
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && mouse_x >= cloud_x - BRANCHES_CLOUD_HALFWIDTH && mouse_x < cloud_x - BRANCHES_CLOUD_HALFWIDTH + BRANCHES_CLOUD_WIDTH && mouse_y >= BRANCHES_CLOUD_Y - BRANCHES_CLOUD_HALFHEIGHT && mouse_y < BRANCHES_CLOUD_Y - BRANCHES_CLOUD_HALFHEIGHT + BRANCHES_CLOUD_HEIGHT)
|
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && mouse_x >= cloud_x - BRANCHES_CLOUD_HALFWIDTH && mouse_x < cloud_x - BRANCHES_CLOUD_HALFWIDTH + BRANCHES_CLOUD_WIDTH && mouse_y >= BRANCHES_CLOUD_Y - BRANCHES_CLOUD_HALFHEIGHT && mouse_y < BRANCHES_CLOUD_Y - BRANCHES_CLOUD_HALFHEIGHT + BRANCHES_CLOUD_HEIGHT)
|
||||||
item_under_mouse = ITEM_UNDER_MOUSE_CLOUD;
|
item_under_mouse = ITEM_UNDER_MOUSE_CLOUD;
|
||||||
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && changes_since_current_branch && mouse_x >= BranchCurrX[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFWIDTH && mouse_x < BranchCurrX[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFWIDTH + DIGIT_RECT_WIDTH && mouse_y >= BranchCurrY[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFHEIGHT && mouse_y < BranchCurrY[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFHEIGHT + DIGIT_RECT_HEIGHT)
|
if (item_under_mouse == ITEM_UNDER_MOUSE_NONE && changes_since_current_branch && mouse_x >= BranchCurrX[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFWIDTH_COLLISION && mouse_x < BranchCurrX[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFWIDTH_COLLISION + DIGIT_RECT_WIDTH_COLLISION && mouse_y >= BranchCurrY[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFHEIGHT_COLLISION && mouse_y < BranchCurrY[TOTAL_BOOKMARKS] - DIGIT_RECT_HALFHEIGHT_COLLISION + DIGIT_RECT_HEIGHT_COLLISION)
|
||||||
item_under_mouse = TOTAL_BOOKMARKS;
|
item_under_mouse = TOTAL_BOOKMARKS;
|
||||||
if (prev_item_under_mouse != item_under_mouse)
|
if (prev_item_under_mouse != item_under_mouse)
|
||||||
must_redraw_branches_tree = true;
|
must_redraw_branches_tree = true;
|
||||||
|
|
|
@ -30,10 +30,12 @@ enum COMMANDS
|
||||||
#define BRANCHES_BITMAP_WIDTH 170
|
#define BRANCHES_BITMAP_WIDTH 170
|
||||||
#define BRANCHES_BITMAP_HEIGHT 145
|
#define BRANCHES_BITMAP_HEIGHT 145
|
||||||
#define BRANCHES_ANIMATION_FRAMES 12
|
#define BRANCHES_ANIMATION_FRAMES 12
|
||||||
#define BRANCHES_BITMAP_FRAMENUM_X 0
|
#define BRANCHES_BITMAP_FRAMENUM_X 2
|
||||||
#define BRANCHES_BITMAP_FRAMENUM_Y 0
|
#define BRANCHES_BITMAP_FRAMENUM_Y 1
|
||||||
#define BRANCHES_BITMAP_TIME_X 0
|
#define BRANCHES_BITMAP_TIME_X 2
|
||||||
#define BRANCHES_BITMAP_TIME_Y BRANCHES_BITMAP_HEIGHT - 17
|
#define BRANCHES_BITMAP_TIME_Y BRANCHES_BITMAP_HEIGHT - 17
|
||||||
|
#define BRANCHES_TEXT_SHADOW_COLOR 0xFFFFFF
|
||||||
|
#define BRANCHES_TEXT_COLOR 0x7F0000
|
||||||
// constants for drawing branches tree
|
// constants for drawing branches tree
|
||||||
#define BRANCHES_CANVAS_WIDTH 146
|
#define BRANCHES_CANVAS_WIDTH 146
|
||||||
#define BRANCHES_CANVAS_HEIGHT 130
|
#define BRANCHES_CANVAS_HEIGHT 130
|
||||||
|
@ -58,9 +60,13 @@ enum COMMANDS
|
||||||
#define BLUE_DIGITS_SPRITESHEET_DX DIGIT_BITMAP_WIDTH*TOTAL_BOOKMARKS
|
#define BLUE_DIGITS_SPRITESHEET_DX DIGIT_BITMAP_WIDTH*TOTAL_BOOKMARKS
|
||||||
#define MOUSEOVER_DIGITS_SPRITESHEET_DY DIGIT_BITMAP_HEIGHT
|
#define MOUSEOVER_DIGITS_SPRITESHEET_DY DIGIT_BITMAP_HEIGHT
|
||||||
#define DIGIT_RECT_WIDTH 11
|
#define DIGIT_RECT_WIDTH 11
|
||||||
|
#define DIGIT_RECT_WIDTH_COLLISION (DIGIT_RECT_WIDTH + 2)
|
||||||
#define DIGIT_RECT_HALFWIDTH DIGIT_RECT_WIDTH/2
|
#define DIGIT_RECT_HALFWIDTH DIGIT_RECT_WIDTH/2
|
||||||
|
#define DIGIT_RECT_HALFWIDTH_COLLISION (DIGIT_RECT_HALFWIDTH + 1)
|
||||||
#define DIGIT_RECT_HEIGHT 15
|
#define DIGIT_RECT_HEIGHT 15
|
||||||
|
#define DIGIT_RECT_HEIGHT_COLLISION (DIGIT_RECT_HEIGHT + 2)
|
||||||
#define DIGIT_RECT_HALFHEIGHT DIGIT_RECT_HEIGHT/2
|
#define DIGIT_RECT_HALFHEIGHT DIGIT_RECT_HEIGHT/2
|
||||||
|
#define DIGIT_RECT_HALFHEIGHT_COLLISION (DIGIT_RECT_HALFHEIGHT + 1)
|
||||||
#define BRANCHES_CLOUD_WIDTH 26
|
#define BRANCHES_CLOUD_WIDTH 26
|
||||||
#define BRANCHES_CLOUD_HALFWIDTH BRANCHES_CLOUD_WIDTH/2
|
#define BRANCHES_CLOUD_HALFWIDTH BRANCHES_CLOUD_WIDTH/2
|
||||||
#define BRANCHES_CLOUD_HEIGHT 15
|
#define BRANCHES_CLOUD_HEIGHT 15
|
||||||
|
|
|
@ -227,6 +227,12 @@ void PIANO_ROLL::init()
|
||||||
list_row_height = 14;
|
list_row_height = 14;
|
||||||
}
|
}
|
||||||
ListView_SetItemCountEx(hwndList, 0, LVSICF_NOSCROLL|LVSICF_NOINVALIDATEALL);
|
ListView_SetItemCountEx(hwndList, 0, LVSICF_NOSCROLL|LVSICF_NOINVALIDATEALL);
|
||||||
|
// find header height
|
||||||
|
RECT wrect;
|
||||||
|
if (GetWindowRect(hwndHeader, &wrect))
|
||||||
|
list_header_height = wrect.bottom - wrect.top;
|
||||||
|
else
|
||||||
|
list_header_height = 20;
|
||||||
|
|
||||||
hrmenu = LoadMenu(fceu_hInstance,"TASEDITORCONTEXTMENUS");
|
hrmenu = LoadMenu(fceu_hInstance,"TASEDITORCONTEXTMENUS");
|
||||||
header_colors.resize(TOTAL_COLUMNS);
|
header_colors.resize(TOTAL_COLUMNS);
|
||||||
|
@ -235,6 +241,7 @@ void PIANO_ROLL::init()
|
||||||
tme.dwFlags = TME_LEAVE;
|
tme.dwFlags = TME_LEAVE;
|
||||||
tme.hwndTrack = hwndHeader;
|
tme.hwndTrack = hwndHeader;
|
||||||
drag_mode = DRAG_MODE_NONE;
|
drag_mode = DRAG_MODE_NONE;
|
||||||
|
rbutton_drag_mode = false;
|
||||||
}
|
}
|
||||||
void PIANO_ROLL::free()
|
void PIANO_ROLL::free()
|
||||||
{
|
{
|
||||||
|
@ -341,24 +348,30 @@ void PIANO_ROLL::update()
|
||||||
if (GetAsyncKeyState(GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON) >= 0)
|
if (GetAsyncKeyState(GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON) >= 0)
|
||||||
FinishDrag();
|
FinishDrag();
|
||||||
}
|
}
|
||||||
// also scroll Piano Roll if user is dragging cursor outside
|
if (rbutton_drag_mode)
|
||||||
if (drag_mode != DRAG_MODE_NONE)
|
{
|
||||||
|
// check if user released right button
|
||||||
|
if (GetAsyncKeyState(GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON) >= 0)
|
||||||
|
rbutton_drag_mode = false;
|
||||||
|
}
|
||||||
|
// scroll Piano Roll if user is dragging cursor outside
|
||||||
|
if (drag_mode != DRAG_MODE_NONE || rbutton_drag_mode)
|
||||||
{
|
{
|
||||||
POINT p;
|
POINT p;
|
||||||
if (GetCursorPos(&p))
|
if (GetCursorPos(&p))
|
||||||
{
|
{
|
||||||
int scroll_dx = 0, scroll_dy = 0;
|
|
||||||
RECT wrect;
|
|
||||||
GetWindowRect(hwndList, &wrect);
|
|
||||||
ScreenToClient(hwndList, &p);
|
ScreenToClient(hwndList, &p);
|
||||||
if (p.x < 0)
|
RECT wrect;
|
||||||
scroll_dx = p.x;
|
GetClientRect(hwndList, &wrect);
|
||||||
else if (p.x > (wrect.right - wrect.left))
|
int scroll_dx = 0, scroll_dy = 0;
|
||||||
scroll_dx = p.x - (wrect.right - wrect.left);
|
if (p.x < SCROLLING_BORDER_SIZE)
|
||||||
if (p.y < 0)
|
scroll_dx = p.x - SCROLLING_BORDER_SIZE;
|
||||||
scroll_dy = p.y;
|
else if (p.x > (wrect.right - wrect.left - SCROLLING_BORDER_SIZE))
|
||||||
else if (p.y > (wrect.bottom - wrect.top))
|
scroll_dx = p.x - (wrect.right - wrect.left - SCROLLING_BORDER_SIZE);
|
||||||
scroll_dy = p.y - (wrect.bottom - wrect.top);
|
if (p.y < (list_header_height + SCROLLING_BORDER_SIZE))
|
||||||
|
scroll_dy = p.y - (list_header_height + SCROLLING_BORDER_SIZE);
|
||||||
|
else if (p.y > (wrect.bottom - wrect.top - SCROLLING_BORDER_SIZE))
|
||||||
|
scroll_dy = p.y - (wrect.bottom - wrect.top - SCROLLING_BORDER_SIZE);
|
||||||
if (scroll_dx || scroll_dy)
|
if (scroll_dx || scroll_dy)
|
||||||
ListView_Scroll(hwndList, scroll_dx, scroll_dy);
|
ListView_Scroll(hwndList, scroll_dx, scroll_dy);
|
||||||
}
|
}
|
||||||
|
@ -368,7 +381,6 @@ void PIANO_ROLL::update()
|
||||||
{
|
{
|
||||||
case DRAG_MODE_PLAYBACK:
|
case DRAG_MODE_PLAYBACK:
|
||||||
{
|
{
|
||||||
if (!playback.pause_frame)
|
|
||||||
DragPlaybackCursor();
|
DragPlaybackCursor();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -411,8 +423,6 @@ void PIANO_ROLL::update()
|
||||||
POINT p;
|
POINT p;
|
||||||
if (GetCursorPos(&p))
|
if (GetCursorPos(&p))
|
||||||
{
|
{
|
||||||
RECT wrect;
|
|
||||||
GetWindowRect(hwndList, &wrect);
|
|
||||||
ScreenToClient(hwndList, &p);
|
ScreenToClient(hwndList, &p);
|
||||||
int drawing_current_x = p.x + GetScrollPos(hwndList, SB_HORZ);
|
int drawing_current_x = p.x + GetScrollPos(hwndList, SB_HORZ);
|
||||||
int drawing_current_y = p.y + GetScrollPos(hwndList, SB_VERT) * list_row_height;
|
int drawing_current_y = p.y + GetScrollPos(hwndList, SB_VERT) * list_row_height;
|
||||||
|
@ -521,10 +531,10 @@ void PIANO_ROLL::update()
|
||||||
POINT p;
|
POINT p;
|
||||||
if (GetCursorPos(&p))
|
if (GetCursorPos(&p))
|
||||||
{
|
{
|
||||||
RECT wrect;
|
|
||||||
GetWindowRect(hwndList, &wrect);
|
|
||||||
ScreenToClient(hwndList, &p);
|
ScreenToClient(hwndList, &p);
|
||||||
if (p.x >= 0 && p.y >= 0 && p.x < (wrect.right - wrect.left) && p.y < (wrect.bottom - wrect.top))
|
RECT wrect;
|
||||||
|
GetClientRect(hwndList, &wrect);
|
||||||
|
if (p.x >= 0 && p.y >= list_header_height && p.x < (wrect.right - wrect.left) && p.y < (wrect.bottom - wrect.top))
|
||||||
{
|
{
|
||||||
// perform hit test
|
// perform hit test
|
||||||
LVHITTESTINFO info;
|
LVHITTESTINFO info;
|
||||||
|
@ -1466,12 +1476,23 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
if ((int)(piano_roll.vk_control_release_time + GetDoubleClickTime()) > clock())
|
if ((int)(piano_roll.vk_control_release_time + GetDoubleClickTime()) > clock())
|
||||||
piano_roll.FollowSelection();
|
piano_roll.FollowSelection();
|
||||||
}
|
}
|
||||||
// only allow 8 keys
|
if (taseditor_config.keyboard_for_piano_roll)
|
||||||
if (taseditor_config.keyboard_for_piano_roll && (wParam == VK_LEFT || wParam == VK_UP || wParam == VK_RIGHT || wParam == VK_DOWN || wParam == VK_END || wParam == VK_HOME || wParam == VK_PRIOR || wParam == VK_NEXT))
|
|
||||||
{
|
{
|
||||||
|
// only allow 8 keys, and change behaviour of Right and Left keys
|
||||||
|
if (wParam == VK_LEFT)
|
||||||
|
{
|
||||||
|
// faster speed of horizontal scrolling, and don't scroll vertically to the selection
|
||||||
|
ListView_Scroll(piano_roll.hwndList, -COLUMN_BUTTON_WIDTH, 0);
|
||||||
|
} else if (wParam == VK_RIGHT)
|
||||||
|
{
|
||||||
|
ListView_Scroll(piano_roll.hwndList, COLUMN_BUTTON_WIDTH, 0);
|
||||||
|
} else if (wParam == VK_UP || wParam == VK_DOWN || wParam == VK_END || wParam == VK_HOME || wParam == VK_PRIOR || wParam == VK_NEXT)
|
||||||
|
{
|
||||||
|
// these 6 keys will be handled by hwndList_oldWndProc
|
||||||
piano_roll.must_check_item_under_mouse = true;
|
piano_roll.must_check_item_under_mouse = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
|
@ -1492,7 +1513,6 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
if(column_index == COLUMN_ICONS)
|
if(column_index == COLUMN_ICONS)
|
||||||
{
|
{
|
||||||
// click on the "icons" column
|
// click on the "icons" column
|
||||||
piano_roll.DragPlaybackCursor();
|
|
||||||
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
||||||
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
||||||
} else if(column_index == COLUMN_FRAMENUM || column_index == COLUMN_FRAMENUM2)
|
} else if(column_index == COLUMN_FRAMENUM || column_index == COLUMN_FRAMENUM2)
|
||||||
|
@ -1504,11 +1524,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
if (taseditor_config.deselect_on_doubleclick)
|
if (taseditor_config.deselect_on_doubleclick)
|
||||||
selection.ClearSelection();
|
selection.ClearSelection();
|
||||||
if (taseditor_config.doubleclick_affects_playback)
|
if (taseditor_config.doubleclick_affects_playback)
|
||||||
{
|
|
||||||
piano_roll.DragPlaybackCursor();
|
piano_roll.DragPlaybackCursor();
|
||||||
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
|
||||||
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if (row_index >= 0)
|
if (row_index >= 0)
|
||||||
|
@ -1611,23 +1627,23 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
// Shift + wheel = Playback rewind full(speed)/forward full(speed)
|
// Shift + wheel = Playback rewind full(speed)/forward full(speed)
|
||||||
if (zDelta < 0)
|
if (zDelta < 0)
|
||||||
playback.ForwardFull(-zDelta / 120);
|
playback.ForwardFull(-zDelta / WHEEL_DELTA);
|
||||||
else if (zDelta > 0)
|
else if (zDelta > 0)
|
||||||
playback.RewindFull(zDelta / 120);
|
playback.RewindFull(zDelta / WHEEL_DELTA);
|
||||||
} else if (fwKeys & MK_CONTROL)
|
} else if (fwKeys & MK_CONTROL)
|
||||||
{
|
{
|
||||||
// Ctrl + wheel = Selection rewind full(speed)/forward full(speed)
|
// Ctrl + wheel = Selection rewind full(speed)/forward full(speed)
|
||||||
if (zDelta < 0)
|
if (zDelta < 0)
|
||||||
selection.JumpNextMarker(-zDelta / 120);
|
selection.JumpNextMarker(-zDelta / WHEEL_DELTA);
|
||||||
else if (zDelta > 0)
|
else if (zDelta > 0)
|
||||||
selection.JumpPrevMarker(zDelta / 120);
|
selection.JumpPrevMarker(zDelta / WHEEL_DELTA);
|
||||||
} else if (alt_pressed || fwKeys & MK_RBUTTON)
|
} else if (alt_pressed || fwKeys & MK_RBUTTON)
|
||||||
{
|
{
|
||||||
// Right button + wheel = Alt + wheel = rewind/forward
|
// Right button + wheel = Alt + wheel = rewind/forward
|
||||||
// if both Right button and Alt are pressed, move 2x faster
|
// if both Right button and Alt are pressed, move 4x faster
|
||||||
if (alt_pressed && fwKeys & MK_RBUTTON)
|
if (alt_pressed && fwKeys & MK_RBUTTON)
|
||||||
zDelta *= BOOST_WHEN_BOTH_RIGHTBUTTON_AND_ALT_PRESSED;
|
zDelta *= BOOST_WHEN_BOTH_RIGHTBUTTON_AND_ALT_PRESSED;
|
||||||
int destination_frame = currFrameCounter - (zDelta / 120);
|
int destination_frame = currFrameCounter - (zDelta / WHEEL_DELTA);
|
||||||
if (destination_frame < 0) destination_frame = 0;
|
if (destination_frame < 0) destination_frame = 0;
|
||||||
int lastCursor = currFrameCounter;
|
int lastCursor = currFrameCounter;
|
||||||
playback.jump(destination_frame);
|
playback.jump(destination_frame);
|
||||||
|
@ -1642,13 +1658,14 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
return SendMessage(history.hwndHistoryList, WM_MOUSEWHEEL_RESENT, wParam, lParam);
|
return SendMessage(history.hwndHistoryList, WM_MOUSEWHEEL_RESENT, wParam, lParam);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// normal scrolling
|
// normal scrolling - make it 2x faster than usual
|
||||||
CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
|
CallWindowProc(hwndList_oldWndProc, hWnd, msg, MAKELONG(fwKeys, zDelta * PIANO_ROLL_SCROLLING_BOOST), lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
case WM_RBUTTONDBLCLK:
|
case WM_RBUTTONDBLCLK:
|
||||||
|
piano_roll.rbutton_drag_mode = true;
|
||||||
if (GetFocus() != hWnd)
|
if (GetFocus() != hWnd)
|
||||||
SetFocus(hWnd);
|
SetFocus(hWnd);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1676,7 +1693,6 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
// user clicked on left border of the Piano Roll
|
// user clicked on left border of the Piano Roll
|
||||||
// consider this as a "misclick" on Piano Roll's first column
|
// consider this as a "misclick" on Piano Roll's first column
|
||||||
piano_roll.DragPlaybackCursor();
|
|
||||||
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
||||||
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1692,9 +1708,37 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
case LVM_ENSUREVISIBLE:
|
case LVM_ENSUREVISIBLE:
|
||||||
{
|
{
|
||||||
|
// Piano Roll probably scrolls
|
||||||
piano_roll.must_check_item_under_mouse = true;
|
piano_roll.must_check_item_under_mouse = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case WM_VSCROLL:
|
||||||
|
{
|
||||||
|
// fix for known WinXP bug
|
||||||
|
if (LOWORD(wParam) == SB_LINEUP)
|
||||||
|
{
|
||||||
|
ListView_Scroll(piano_roll.hwndList, 0, -piano_roll.list_row_height);
|
||||||
|
return 0;
|
||||||
|
} else if (LOWORD(wParam) == SB_LINEDOWN)
|
||||||
|
{
|
||||||
|
ListView_Scroll(piano_roll.hwndList, 0, piano_roll.list_row_height);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case WM_HSCROLL:
|
||||||
|
{
|
||||||
|
if (LOWORD(wParam) == SB_LINELEFT)
|
||||||
|
{
|
||||||
|
ListView_Scroll(piano_roll.hwndList, -COLUMN_BUTTON_WIDTH, 0);
|
||||||
|
return 0;
|
||||||
|
} else if (LOWORD(wParam) == SB_LINERIGHT)
|
||||||
|
{
|
||||||
|
ListView_Scroll(piano_roll.hwndList, COLUMN_BUTTON_WIDTH, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
|
return CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
|
||||||
|
|
|
@ -17,11 +17,15 @@
|
||||||
#define HEADER_LIGHT_UPDATE_TICK 40 // 25FPS
|
#define HEADER_LIGHT_UPDATE_TICK 40 // 25FPS
|
||||||
#define HEADER_DX_FIX 4
|
#define HEADER_DX_FIX 4
|
||||||
|
|
||||||
|
#define PIANO_ROLL_SCROLLING_BOOST 2
|
||||||
#define BOOST_WHEN_BOTH_RIGHTBUTTON_AND_ALT_PRESSED 4
|
#define BOOST_WHEN_BOTH_RIGHTBUTTON_AND_ALT_PRESSED 4
|
||||||
|
|
||||||
#define MARKER_DRAG_BOX_ALPHA 175
|
#define MARKER_DRAG_BOX_ALPHA 175
|
||||||
#define DRAWING_MIN_LINE_LEN 14 // = min(list_row_width, list_row_height) in pixels
|
#define DRAWING_MIN_LINE_LEN 14 // = min(list_row_width, list_row_height) in pixels
|
||||||
|
|
||||||
|
#define SCROLLING_BORDER_SIZE 8 // in pixels
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
COLUMN_ICONS,
|
COLUMN_ICONS,
|
||||||
|
@ -176,8 +180,9 @@ public:
|
||||||
HWND hwndList, hwndHeader;
|
HWND hwndList, hwndHeader;
|
||||||
TRACKMOUSEEVENT tme;
|
TRACKMOUSEEVENT tme;
|
||||||
|
|
||||||
|
int list_row_top, list_row_height, list_header_height;
|
||||||
unsigned int drag_mode;
|
unsigned int drag_mode;
|
||||||
int list_row_top, list_row_height;
|
bool rbutton_drag_mode;
|
||||||
int marker_drag_box_dx, marker_drag_box_dy;
|
int marker_drag_box_dx, marker_drag_box_dy;
|
||||||
int marker_drag_framenum;
|
int marker_drag_framenum;
|
||||||
int drawing_last_x, drawing_last_y;
|
int drawing_last_x, drawing_last_y;
|
||||||
|
|
|
@ -207,7 +207,6 @@ void PLAYBACK::update()
|
||||||
bookmarks.RedrawChangedBookmarks(currFrameCounter);
|
bookmarks.RedrawChangedBookmarks(currFrameCounter);
|
||||||
lastCursor = currFrameCounter;
|
lastCursor = currFrameCounter;
|
||||||
piano_roll.FollowPlaybackIfNeeded();
|
piano_roll.FollowPlaybackIfNeeded();
|
||||||
if (!turbo)
|
|
||||||
// enforce redrawing now
|
// enforce redrawing now
|
||||||
UpdateWindow(piano_roll.hwndList);
|
UpdateWindow(piano_roll.hwndList);
|
||||||
// lazy update of "Playback's Marker text"
|
// lazy update of "Playback's Marker text"
|
||||||
|
|
|
@ -24,18 +24,19 @@ extern TASEDITOR_WINDOW taseditor_window;
|
||||||
extern BOOKMARKS bookmarks;
|
extern BOOKMARKS bookmarks;
|
||||||
extern PIANO_ROLL piano_roll;
|
extern PIANO_ROLL piano_roll;
|
||||||
extern MARKERS_MANAGER markers_manager;
|
extern MARKERS_MANAGER markers_manager;
|
||||||
|
extern PLAYBACK playback;
|
||||||
|
|
||||||
LRESULT CALLBACK ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
LRESULT APIENTRY MarkerNoteDescrWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
LRESULT APIENTRY MarkerNoteDescrWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
char szClassName[] = "ScrBmp";
|
char szClassName[] = "ScrBmp";
|
||||||
char szClassName2[] = "MarketNoteTooltip";
|
char szClassName2[] = "MarketNoteDescr";
|
||||||
|
|
||||||
POPUP_DISPLAY::POPUP_DISPLAY()
|
POPUP_DISPLAY::POPUP_DISPLAY()
|
||||||
{
|
{
|
||||||
hwndScrBmp = 0;
|
hwndScrBmp = 0;
|
||||||
hwndMarkerNoteTooltip = 0;
|
hwndMarkerNoteDescr = 0;
|
||||||
// create BITMAPINFO
|
// create BITMAPINFO
|
||||||
scr_bmi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // 256 color in palette
|
scr_bmi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // 256 color in palette
|
||||||
scr_bmi->bmiHeader.biSize = sizeof(scr_bmi->bmiHeader);
|
scr_bmi->bmiHeader.biSize = sizeof(scr_bmi->bmiHeader);
|
||||||
|
@ -119,10 +120,10 @@ void POPUP_DISPLAY::reset()
|
||||||
DestroyWindow(hwndScrBmp);
|
DestroyWindow(hwndScrBmp);
|
||||||
hwndScrBmp = 0;
|
hwndScrBmp = 0;
|
||||||
}
|
}
|
||||||
if (hwndMarkerNoteTooltip)
|
if (hwndMarkerNoteDescr)
|
||||||
{
|
{
|
||||||
DestroyWindow(hwndMarkerNoteTooltip);
|
DestroyWindow(hwndMarkerNoteDescr);
|
||||||
hwndMarkerNoteTooltip = 0;
|
hwndMarkerNoteDescr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,19 +142,22 @@ void POPUP_DISPLAY::update()
|
||||||
RedrawScreenshotBitmap();
|
RedrawScreenshotBitmap();
|
||||||
ShowWindow(hwndScrBmp, SW_SHOWNA);
|
ShowWindow(hwndScrBmp, SW_SHOWNA);
|
||||||
}
|
}
|
||||||
if (taseditor_config.show_branch_descr && !hwndMarkerNoteTooltip)
|
if (taseditor_config.show_branch_descr && !hwndMarkerNoteDescr)
|
||||||
{
|
{
|
||||||
hwndMarkerNoteTooltip = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName2, szClassName2, WS_POPUP, taseditor_config.wndx + tooltip_x, taseditor_config.wndy + tooltip_y, MARKER_NOTE_TOOLTIP_WIDTH, MARKER_NOTE_TOOLTIP_HEIGHT, taseditor_window.hwndTasEditor, NULL, fceu_hInstance, NULL);
|
RECT wrect;
|
||||||
ChangeTooltipText();
|
GetWindowRect(playback.hwndPlaybackMarkerEdit, &wrect);
|
||||||
ShowWindow(hwndMarkerNoteTooltip, SW_SHOWNA);
|
descr_x = scr_bmp_x + (SCREENSHOT_WIDTH - (wrect.right - wrect.left)) / 2;
|
||||||
|
hwndMarkerNoteDescr = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName2, szClassName2, WS_POPUP, taseditor_config.wndx + descr_x, taseditor_config.wndy + descr_y, wrect.right - wrect.left, wrect.bottom - wrect.top, taseditor_window.hwndTasEditor, NULL, fceu_hInstance, NULL);
|
||||||
|
ChangeDescrText();
|
||||||
|
ShowWindow(hwndMarkerNoteDescr, SW_SHOWNA);
|
||||||
}
|
}
|
||||||
// change screenshot_bitmap pic and tooltip text if needed
|
// change screenshot_bitmap pic and description text if needed
|
||||||
if (screenshot_currently_shown != bookmarks.item_under_mouse)
|
if (screenshot_currently_shown != bookmarks.item_under_mouse)
|
||||||
{
|
{
|
||||||
if (taseditor_config.show_branch_screenshots)
|
if (taseditor_config.show_branch_screenshots)
|
||||||
ChangeScreenshotBitmap();
|
ChangeScreenshotBitmap();
|
||||||
if (taseditor_config.show_branch_descr)
|
if (taseditor_config.show_branch_descr)
|
||||||
ChangeTooltipText();
|
ChangeDescrText();
|
||||||
screenshot_currently_shown = bookmarks.item_under_mouse;
|
screenshot_currently_shown = bookmarks.item_under_mouse;
|
||||||
}
|
}
|
||||||
if (scr_bmp_phase < SCR_BMP_PHASE_MAX)
|
if (scr_bmp_phase < SCR_BMP_PHASE_MAX)
|
||||||
|
@ -167,10 +171,10 @@ void POPUP_DISPLAY::update()
|
||||||
SetLayeredWindowAttributes(hwndScrBmp, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
SetLayeredWindowAttributes(hwndScrBmp, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
||||||
UpdateLayeredWindow(hwndScrBmp, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
UpdateLayeredWindow(hwndScrBmp, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
||||||
}
|
}
|
||||||
if (hwndMarkerNoteTooltip)
|
if (hwndMarkerNoteDescr)
|
||||||
{
|
{
|
||||||
SetLayeredWindowAttributes(hwndMarkerNoteTooltip, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
SetLayeredWindowAttributes(hwndMarkerNoteDescr, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
||||||
UpdateLayeredWindow(hwndMarkerNoteTooltip, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
UpdateLayeredWindow(hwndMarkerNoteDescr, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -188,10 +192,10 @@ void POPUP_DISPLAY::update()
|
||||||
SetLayeredWindowAttributes(hwndScrBmp, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
SetLayeredWindowAttributes(hwndScrBmp, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
||||||
UpdateLayeredWindow(hwndScrBmp, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
UpdateLayeredWindow(hwndScrBmp, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
||||||
}
|
}
|
||||||
if (hwndMarkerNoteTooltip)
|
if (hwndMarkerNoteDescr)
|
||||||
{
|
{
|
||||||
SetLayeredWindowAttributes(hwndMarkerNoteTooltip, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
SetLayeredWindowAttributes(hwndMarkerNoteDescr, 0, (255 * phase_alpha) / SCR_BMP_PHASE_ALPHA_MAX, LWA_ALPHA);
|
||||||
UpdateLayeredWindow(hwndMarkerNoteTooltip, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
UpdateLayeredWindow(hwndMarkerNoteDescr, 0, 0, 0, 0, 0, 0, &blend, ULW_ALPHA);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -202,10 +206,10 @@ void POPUP_DISPLAY::update()
|
||||||
DestroyWindow(hwndScrBmp);
|
DestroyWindow(hwndScrBmp);
|
||||||
hwndScrBmp = 0;
|
hwndScrBmp = 0;
|
||||||
}
|
}
|
||||||
if (hwndMarkerNoteTooltip)
|
if (hwndMarkerNoteDescr)
|
||||||
{
|
{
|
||||||
DestroyWindow(hwndMarkerNoteTooltip);
|
DestroyWindow(hwndMarkerNoteDescr);
|
||||||
hwndMarkerNoteTooltip = 0;
|
hwndMarkerNoteDescr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,14 +236,14 @@ void POPUP_DISPLAY::RedrawScreenshotBitmap()
|
||||||
if (temp_bmp && temp_bmp != scr_bmp)
|
if (temp_bmp && temp_bmp != scr_bmp)
|
||||||
DeleteObject(temp_bmp);
|
DeleteObject(temp_bmp);
|
||||||
}
|
}
|
||||||
void POPUP_DISPLAY::ChangeTooltipText()
|
void POPUP_DISPLAY::ChangeDescrText()
|
||||||
{
|
{
|
||||||
// retrieve info from the pointed bookmark's markers
|
// retrieve info from the pointed bookmark's markers
|
||||||
int frame = bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.jump_frame;
|
int frame = bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.jump_frame;
|
||||||
int marker_id = markers_manager.GetMarkerUp(bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.GetMarkers(), frame);
|
int marker_id = markers_manager.GetMarkerUp(bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.GetMarkers(), frame);
|
||||||
char new_text[MAX_NOTE_LEN];
|
char new_text[MAX_NOTE_LEN];
|
||||||
strcpy(new_text, markers_manager.GetNote(bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.GetMarkers(), marker_id).c_str());
|
strcpy(new_text, markers_manager.GetNote(bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.GetMarkers(), marker_id).c_str());
|
||||||
SetWindowText(marker_note_tooltip, new_text);
|
SetWindowText(marker_note_descr, new_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void POPUP_DISPLAY::ParentWindowMoved()
|
void POPUP_DISPLAY::ParentWindowMoved()
|
||||||
|
@ -250,13 +254,15 @@ void POPUP_DISPLAY::ParentWindowMoved()
|
||||||
GetWindowRect(GetDlgItem(taseditor_window.hwndTasEditor, IDC_BOOKMARKS_BOX), &temp_rect);
|
GetWindowRect(GetDlgItem(taseditor_window.hwndTasEditor, IDC_BOOKMARKS_BOX), &temp_rect);
|
||||||
scr_bmp_x = temp_rect.left - SCREENSHOT_WIDTH - SCR_BMP_DX - parent_rect.left;
|
scr_bmp_x = temp_rect.left - SCREENSHOT_WIDTH - SCR_BMP_DX - parent_rect.left;
|
||||||
scr_bmp_y = (temp_rect.bottom - SCREENSHOT_HEIGHT) - parent_rect.top;
|
scr_bmp_y = (temp_rect.bottom - SCREENSHOT_HEIGHT) - parent_rect.top;
|
||||||
tooltip_x = scr_bmp_x + (SCREENSHOT_WIDTH - MARKER_NOTE_TOOLTIP_WIDTH) / 2;
|
RECT wrect;
|
||||||
tooltip_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP;
|
GetWindowRect(playback.hwndPlaybackMarkerEdit, &wrect);
|
||||||
|
descr_x = scr_bmp_x + (SCREENSHOT_WIDTH - (wrect.right - wrect.left)) / 2;
|
||||||
|
descr_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_DESCR_GAP;
|
||||||
// if popup windows are currently shown, update their positions
|
// if popup windows are currently shown, update their positions
|
||||||
if (hwndScrBmp)
|
if (hwndScrBmp)
|
||||||
SetWindowPos(hwndScrBmp, 0, taseditor_config.wndx + scr_bmp_x, taseditor_config.wndy + scr_bmp_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
|
SetWindowPos(hwndScrBmp, 0, taseditor_config.wndx + scr_bmp_x, taseditor_config.wndy + scr_bmp_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
if (hwndMarkerNoteTooltip)
|
if (hwndMarkerNoteDescr)
|
||||||
SetWindowPos(hwndMarkerNoteTooltip, 0, taseditor_config.wndx + tooltip_x, taseditor_config.wndy + tooltip_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
|
SetWindowPos(hwndMarkerNoteDescr, 0, taseditor_config.wndx + descr_x, taseditor_config.wndy + descr_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
LRESULT APIENTRY ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT APIENTRY ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -282,8 +288,10 @@ LRESULT APIENTRY MarkerNoteDescrWndProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
// create static text field
|
// create static text field
|
||||||
popup_display.marker_note_tooltip = CreateWindow(WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_SUNKEN, 1, 1, MARKER_NOTE_TOOLTIP_WIDTH - 2, MARKER_NOTE_TOOLTIP_HEIGHT - 2, hwnd, NULL, NULL, NULL);
|
RECT wrect;
|
||||||
SendMessage(popup_display.marker_note_tooltip, WM_SETFONT, (WPARAM)piano_roll.hMarkersEditFont, 0);
|
GetWindowRect(playback.hwndPlaybackMarkerEdit, &wrect);
|
||||||
|
popup_display.marker_note_descr = CreateWindow(WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_ENDELLIPSIS | SS_SUNKEN, 1, 1, wrect.right - wrect.left - 2, wrect.bottom - wrect.top - 2, hwnd, NULL, NULL, NULL);
|
||||||
|
SendMessage(popup_display.marker_note_descr, WM_SETFONT, (WPARAM)piano_roll.hMarkersEditFont, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -4,10 +4,7 @@
|
||||||
#define SCR_BMP_PHASE_ALPHA_MAX 8
|
#define SCR_BMP_PHASE_ALPHA_MAX 8
|
||||||
#define SCR_BMP_DX 7
|
#define SCR_BMP_DX 7
|
||||||
|
|
||||||
#define SCR_BMP_TOOLTIP_GAP 2
|
#define SCR_BMP_DESCR_GAP 2
|
||||||
|
|
||||||
#define MARKER_NOTE_TOOLTIP_WIDTH 360
|
|
||||||
#define MARKER_NOTE_TOOLTIP_HEIGHT 20
|
|
||||||
|
|
||||||
#define DISPLAY_UPDATE_TICK 40 // update at 25FPS
|
#define DISPLAY_UPDATE_TICK 40 // update at 25FPS
|
||||||
|
|
||||||
|
@ -22,12 +19,12 @@ public:
|
||||||
|
|
||||||
void ChangeScreenshotBitmap();
|
void ChangeScreenshotBitmap();
|
||||||
void RedrawScreenshotBitmap();
|
void RedrawScreenshotBitmap();
|
||||||
void ChangeTooltipText();
|
void ChangeDescrText();
|
||||||
|
|
||||||
void ParentWindowMoved();
|
void ParentWindowMoved();
|
||||||
|
|
||||||
int screenshot_currently_shown;
|
int screenshot_currently_shown;
|
||||||
HWND hwndScrBmp, scr_bmp_pic, hwndMarkerNoteTooltip, marker_note_tooltip;
|
HWND hwndScrBmp, scr_bmp_pic, hwndMarkerNoteDescr, marker_note_descr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int scr_bmp_x;
|
int scr_bmp_x;
|
||||||
|
@ -35,8 +32,8 @@ private:
|
||||||
int scr_bmp_phase;
|
int scr_bmp_phase;
|
||||||
int next_update_time;
|
int next_update_time;
|
||||||
|
|
||||||
int tooltip_x;
|
int descr_x;
|
||||||
int tooltip_y;
|
int descr_y;
|
||||||
|
|
||||||
WNDCLASSEX wincl1, wincl2;
|
WNDCLASSEX wincl1, wincl2;
|
||||||
BLENDFUNCTION blend;
|
BLENDFUNCTION blend;
|
||||||
|
|
|
@ -1330,7 +1330,6 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
&& y > window_items[PIANOROLL_IN_WINDOWITEMS].y
|
&& y > window_items[PIANOROLL_IN_WINDOWITEMS].y
|
||||||
&& y < window_items[PIANOROLL_IN_WINDOWITEMS].y + (wrect.bottom - wrect.top))
|
&& y < window_items[PIANOROLL_IN_WINDOWITEMS].y + (wrect.bottom - wrect.top))
|
||||||
{
|
{
|
||||||
piano_roll.DragPlaybackCursor();
|
|
||||||
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
if (piano_roll.drag_mode == DRAG_MODE_NONE)
|
||||||
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
piano_roll.drag_mode = DRAG_MODE_PLAYBACK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue