Finished the sticky buttons (didn't have any visible effect)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@919 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
77728125fb
commit
3a5b460184
119
engine.c
119
engine.c
@ -2661,68 +2661,77 @@ short Window_clicked_button(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mouse_Y < Window_pos_Y+(12*Menu_factor_Y))
|
if (Input_sticky_control != 0 && !Window_click_in_control(Input_sticky_control))
|
||||||
{
|
{
|
||||||
Move_window(Mouse_X-Window_pos_X,Mouse_Y-Window_pos_Y);
|
// do nothing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
short clicked_button;
|
|
||||||
T_List_button * list;
|
|
||||||
// Check which controls was clicked (by rectangular area)
|
|
||||||
clicked_button = Window_get_clicked_button();
|
|
||||||
|
|
||||||
// Check if it's part of a list control
|
if (Mouse_Y < Window_pos_Y+(12*Menu_factor_Y))
|
||||||
for (list=Window_list_button_list; list!=NULL; list=list->Next)
|
|
||||||
{
|
{
|
||||||
if (list->Entry_button->Number == clicked_button)
|
Move_window(Mouse_X-Window_pos_X,Mouse_Y-Window_pos_Y);
|
||||||
{
|
}
|
||||||
// Click in the textual part of a list.
|
else
|
||||||
short clicked_line;
|
{
|
||||||
clicked_line = (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-list->Entry_button->Pos_Y)>>3;
|
short clicked_button;
|
||||||
if (clicked_line == list->Cursor_position || // Same as before
|
T_List_button * list;
|
||||||
clicked_line >= list->Scroller->Nb_elements) // Below last line
|
|
||||||
return 0;
|
// Check which controls was clicked (by rectangular area)
|
||||||
|
clicked_button = Window_get_clicked_button();
|
||||||
Hide_cursor();
|
|
||||||
// Redraw one item as disabled
|
// Check if it's part of a list control
|
||||||
if (list->Cursor_position>=0 && list->Cursor_position<list->Scroller->Nb_visibles)
|
for (list=Window_list_button_list; list!=NULL; list=list->Next)
|
||||||
list->Draw_list_item(
|
{
|
||||||
list->Entry_button->Pos_X,
|
if (list->Entry_button->Number == clicked_button)
|
||||||
list->Entry_button->Pos_Y + list->Cursor_position * 8,
|
{
|
||||||
list->List_start + list->Cursor_position,
|
// Click in the textual part of a list.
|
||||||
0);
|
short clicked_line;
|
||||||
list->Cursor_position = clicked_line;
|
clicked_line = (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-list->Entry_button->Pos_Y)>>3;
|
||||||
// Redraw one item as enabled
|
if (clicked_line == list->Cursor_position || // Same as before
|
||||||
if (list->Cursor_position>=0 && list->Cursor_position<list->Scroller->Nb_visibles)
|
clicked_line >= list->Scroller->Nb_elements) // Below last line
|
||||||
list->Draw_list_item(
|
return 0;
|
||||||
list->Entry_button->Pos_X,
|
|
||||||
list->Entry_button->Pos_Y + list->Cursor_position * 8,
|
Hide_cursor();
|
||||||
list->List_start + list->Cursor_position,
|
// Redraw one item as disabled
|
||||||
1);
|
if (list->Cursor_position>=0 && list->Cursor_position<list->Scroller->Nb_visibles)
|
||||||
Display_cursor();
|
list->Draw_list_item(
|
||||||
|
list->Entry_button->Pos_X,
|
||||||
// Store the selected value as attribute2
|
list->Entry_button->Pos_Y + list->Cursor_position * 8,
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
list->List_start + list->Cursor_position,
|
||||||
// Return the control ID of the list.
|
0);
|
||||||
return ((Input_sticky_control = list->Number));
|
list->Cursor_position = clicked_line;
|
||||||
}
|
// Redraw one item as enabled
|
||||||
else if (list->Scroller->Number == clicked_button)
|
if (list->Cursor_position>=0 && list->Cursor_position<list->Scroller->Nb_visibles)
|
||||||
{
|
list->Draw_list_item(
|
||||||
// Click in the scroller part of a list
|
list->Entry_button->Pos_X,
|
||||||
if (list->List_start == list->Scroller->Position)
|
list->Entry_button->Pos_Y + list->Cursor_position * 8,
|
||||||
return 0; // Didn't actually move
|
list->List_start + list->Cursor_position,
|
||||||
// Update scroller indices
|
1);
|
||||||
list->Cursor_position += list->List_start;
|
Display_cursor();
|
||||||
list->List_start = list->Scroller->Position;
|
|
||||||
list->Cursor_position -= list->List_start;
|
// Store the selected value as attribute2
|
||||||
// Need to redraw all
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
Hide_cursor();
|
// Return the control ID of the list.
|
||||||
Window_redraw_list(list);
|
return ((Input_sticky_control = list->Number));
|
||||||
Display_cursor();
|
}
|
||||||
}
|
else if (list->Scroller->Number == clicked_button)
|
||||||
|
{
|
||||||
|
// Click in the scroller part of a list
|
||||||
|
if (list->List_start == list->Scroller->Position)
|
||||||
|
return 0; // Didn't actually move
|
||||||
|
// Update scroller indices
|
||||||
|
list->Cursor_position += list->List_start;
|
||||||
|
list->List_start = list->Scroller->Position;
|
||||||
|
list->Cursor_position -= list->List_start;
|
||||||
|
// Need to redraw all
|
||||||
|
Hide_cursor();
|
||||||
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clicked_button;
|
||||||
}
|
}
|
||||||
return clicked_button;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user