Example #1
0
int BC_Pot::repeat_event(int64_t duration)
{
	if(duration == top_level->get_resources()->tooltip_delay)
	{
		if(tooltip_on)
		{
			if(keypress_tooltip_timer > 0)
			{
				keypress_tooltip_timer -= get_resources()->tooltip_delay;
			}
			else
			if(status != POT_HIGH && status != POT_DN)
			{
				hide_tooltip();
			}
		}
		else
		if(status == POT_HIGH)
		{
			if(use_caption && tooltip_text)
			{
				if(!tooltip_text[0] || isdigit(tooltip_text[0]))
				{
					set_tooltip(get_caption());
					show_tooltip(50);
				}
				else
					show_tooltip();
				tooltip_done = 1;
			}
			return 1;
		}
	}
	return 0;
}
Example #2
0
int BC_Pan::button_press_event()
{
	// there are two modes of operation...
	if (popup)
	{	if (popup->is_event_win() && get_button_down() && get_buttonpress() == 1)
		{
			active = 1;
			x_origin = popup->get_cursor_x();
			y_origin = popup->get_cursor_y();
			stick_x_origin = stick_x;
			stick_y_origin = stick_y;
			return 1;
		} else
		{
			deactivate();
			return 0;
		}
	}
	if(is_event_win() && get_button_down() && get_buttonpress() == 1)
	{
		hide_tooltip();
		activate();
		active = 1;
		x_origin = get_cursor_x();
		y_origin = get_cursor_y();
		stick_x_origin = stick_x;
		stick_y_origin = stick_y;
		draw_popup();
		return 1;
	}
	return 0;
}
Example #3
0
static nsresult NSAPI nsTooltipListener_OnHideTooltip(nsITooltipListener *iface)
{
    NSContainer *This = NSTOOLTIP_THIS(iface);

    hide_tooltip(This->doc);

    return NS_OK;
}
Example #4
0
int BC_Pot::cursor_leave_event()
{
	if(status == POT_HIGH)
	{
		status = POT_UP;
		draw(1);
		hide_tooltip();
	}
	return 0;
}
Example #5
0
int BC_Pan::cursor_leave_event()
{
	if(highlighted)
	{
		highlighted = 0;
		hide_tooltip();
		draw(1, 1);
	}
	return 0;
}
Example #6
0
int BC_Pan::button_release_event()
{
	if(popup)
	{
		hide_tooltip();
		deactivate();
		draw(1, 1);
		return 1;
	}
	return 0;
}
Example #7
0
void lua_script_init(lua_State **L,HANDLE **lua_filenotify,__int64 *ft)
{
	char fscript[MAX_PATH]={0};
	int script_changed=FALSE;

	get_lua_script_fname(fscript,sizeof(fscript));

	if(lua_script_enable){
		__int64 tt=0;
		get_last_write_time(fscript,&tt);
		if(tt!=(*ft)){
			script_changed=TRUE;
			hide_tooltip();
		}
	}

	if(lua_script_enable){
		if((*L)==0 || script_changed){
			lua_State *lua;
			lua=luaL_newstate();
			if(lua!=0){
				luaL_openlibs(lua);
				if(luaL_loadfile(lua,fscript)!=LUA_OK){
					printf("luaL_loadfile error:%s\n",lua_tostring(lua, -1));
					show_tooltip(lua_tostring(lua, -1),0,0);
					lua_close(lua);
				}
				else{
					lua_register_c_functions(lua);
					if(lua_pcall(lua,0,0,0)!=LUA_OK){
						printf("lua_pcall error:%s\n",lua_tostring(lua, -1));
						show_tooltip(lua_tostring(lua, -1),0,0);
						lua_close(lua);
					}
					else{
						if((*L)!=0)
							lua_close(*L);
						*L=lua;
						get_last_write_time(fscript,ft);
						lua_error_msg=0;
						hide_tooltip();
					}
				}
			}
		}
	}
	if(*lua_filenotify!=0){
		if(FindNextChangeNotification(*lua_filenotify)==0){
			FindCloseChangeNotification(*lua_filenotify);
			*lua_filenotify=0;
		}
	}
	if(*lua_filenotify==0){
		HANDLE fn;
		char path[MAX_PATH]={0};
		get_ini_path(path,sizeof(path));
		fn=FindFirstChangeNotification(path,FALSE,FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_LAST_WRITE);
		if(fn!=INVALID_HANDLE_VALUE)
			*lua_filenotify=fn;
	}
}