Patch level : 10.0
Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Corretta gestione tasti funzione quando il focus si trovi disgraziatamente sul tab control di un notebook control. Praticamente la combinazione Shift+F12 non funzionava dopo aver cambiato pagina sui documenti interattivi. git-svn-id: svn://10.65.10.50/trunk@19792 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
63d6508b39
commit
fac7a7c37b
@ -1,6 +1,8 @@
|
||||
#include "wxinc.h"
|
||||
#include "incstr.h"
|
||||
|
||||
#include "agasys.h"
|
||||
#include "xvt.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Unzip support
|
||||
@ -234,3 +236,12 @@ bool aga_dde_terminate(unsigned long connection)
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
BOOLEAN xvt_sys_multithread(MULTITHREAD_CALLBACK callback, void* out, const void* in, const void* param,
|
||||
int tot, BOOLEAN WXUNUSED(progind))
|
||||
{
|
||||
BOOLEAN ok = TRUE;
|
||||
for (int i = 0; i < tot && ok; i++)
|
||||
ok = callback(out, in, param, i, tot);
|
||||
return ok;
|
||||
}
|
||||
|
@ -1872,10 +1872,23 @@ XVT_IMAGE xvt_image_capture(WINDOW win, const RCT* src)
|
||||
return (XVT_IMAGE)i;
|
||||
}
|
||||
|
||||
XVT_IMAGE xvt_image_create(XVT_IMAGE_FORMAT format, short width, short height, long reserved)
|
||||
XVT_IMAGE xvt_image_create(XVT_IMAGE_FORMAT format, short width, short height, COLOR color)
|
||||
{
|
||||
TXVT_IMAGE* i = new TXVT_IMAGE;
|
||||
i->Image().Create(width, height);
|
||||
if (color != COLOR_INVALID)
|
||||
{
|
||||
CAST_COLOR(color, rgb);
|
||||
#if wxCHECK_VERSION(2,9,0)
|
||||
if (rgb.Red() == rgb.Green() && rgb.Green() == rgb.Blue())
|
||||
i->Image().Clear(rgb.Red());
|
||||
else
|
||||
#endif
|
||||
{
|
||||
const wxRect rct(0, 0, width, height);
|
||||
i->Image().SetRGB(rct, rgb.Red(), rgb.Green(), rgb.Blue());
|
||||
}
|
||||
}
|
||||
return (XVT_IMAGE)i;
|
||||
}
|
||||
|
||||
@ -2098,6 +2111,29 @@ void xvt_image_transfer(XVT_IMAGE dstimage, XVT_IMAGE srcimage, RCT *dstrctp, RC
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN xvt_image_filter(XVT_IMAGE image, IMAGE_FILTER filter, void* param)
|
||||
{
|
||||
CAST_TIMAGE(image, img);
|
||||
BOOLEAN ok = img != NULL && img->Ok();
|
||||
if (ok)
|
||||
{
|
||||
const short w = img->GetWidth();
|
||||
const short h = img->GetHeight();
|
||||
ok = w > 0 && h > 0;
|
||||
if (ok)
|
||||
{
|
||||
const int nPixelSize = img->HasAlpha() ? 4 : 3;
|
||||
for (short y = 0; y < h; y++)
|
||||
{
|
||||
unsigned char* rgb = img->Image().GetData() + nPixelSize*y;
|
||||
for (short x = 0; x < w; x++, rgb += nPixelSize)
|
||||
filter(x, y, *rgb, *(rgb+1), *(rgb+2), param);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Memory management
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -208,7 +208,7 @@ XVTDLL XVT_HELP_INFO xvt_help_open_helpfile(FILE_SPEC *fs, unsigned long flags)
|
||||
XVTDLL BOOLEAN xvt_help_process_event(XVT_HELP_INFO hi, WINDOW win, EVENT *ev);
|
||||
|
||||
XVTDLL XVT_IMAGE xvt_image_capture(WINDOW win, const RCT* rct);
|
||||
XVTDLL XVT_IMAGE xvt_image_create(XVT_IMAGE_FORMAT format, short width, short height, long reserved);
|
||||
XVTDLL XVT_IMAGE xvt_image_create(XVT_IMAGE_FORMAT format, short width, short height, COLOR color);
|
||||
XVTDLL void xvt_image_destroy(XVT_IMAGE image);
|
||||
XVTDLL int xvt_image_find_clut_index(XVT_IMAGE image, COLOR color);
|
||||
XVTDLL COLOR xvt_image_get_clut(XVT_IMAGE image, short index);
|
||||
@ -224,6 +224,9 @@ XVTDLL void xvt_image_set_ncolors(XVT_IMAGE image, short ncolors);
|
||||
XVTDLL void xvt_image_set_pixel(XVT_IMAGE image, short x, short y, COLOR color);
|
||||
XVTDLL void xvt_image_transfer(XVT_IMAGE dstimage, XVT_IMAGE srcimage, RCT *dstrctp, RCT *srcrctp);
|
||||
|
||||
typedef void (*IMAGE_FILTER)(short x, short y, unsigned char& r, unsigned char& g, unsigned char& b, void* jolly);
|
||||
XVTDLL BOOLEAN xvt_image_filter(XVT_IMAGE image, IMAGE_FILTER filter, void* param);
|
||||
|
||||
XVTDLL int xvt_list_add_item(WINDOW win, short icon, const char* text, int flags);
|
||||
XVTDLL BOOLEAN xvt_list_add(WINDOW win, int index, const char* text);
|
||||
XVTDLL BOOLEAN xvt_list_clear(WINDOW win);
|
||||
@ -384,6 +387,8 @@ XVTDLL long xvt_sys_execute(const char* cmdline, BOOLEAN sync, BOOLEAN iconi
|
||||
XVTDLL long xvt_sys_execute_in_window(const char* cmdline, WINDOW win);
|
||||
XVTDLL long xvt_sys_close_children(WINDOW win);
|
||||
XVTDLL long xvt_sys_close_siblings(WINDOW win);
|
||||
typedef BOOLEAN MULTITHREAD_CALLBACK(void* output, const void* input, const void* params, size_t i, size_t total);
|
||||
XVTDLL BOOLEAN xvt_sys_multithread(MULTITHREAD_CALLBACK callback, void* out, const void* in, const void* param, size_t tot, BOOLEAN progind);
|
||||
|
||||
XVTDLL BOOLEAN xvt_sys_get_host_name(char* name, int maxlen);
|
||||
XVTDLL BOOLEAN xvt_sys_get_user_name(char* name, int maxlen);
|
||||
@ -416,7 +421,7 @@ XVTDLL struct tm* xvt_time_now();
|
||||
XVTDLL long xvt_timer_create(WINDOW win, long interval);
|
||||
XVTDLL void xvt_timer_destroy(long id);
|
||||
|
||||
XVTDLL WINDOW xvt_trayicon_create(WINDOW owned, short icon, const char* tooltip);
|
||||
XVTDLL WINDOW xvt_trayicon_create(WINDOW owner, short icon, const char* tooltip);
|
||||
XVTDLL void xvt_trayicon_destroy(WINDOW tray);
|
||||
|
||||
XVTDLL void xvt_vobj_destroy(WINDOW win);
|
||||
|
@ -87,6 +87,7 @@ class TwxNoteBook : public wxAuiNotebook
|
||||
protected:
|
||||
virtual bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
void OnChar(wxKeyEvent& evt);
|
||||
void OnPageChanging(wxAuiNotebookEvent& e);
|
||||
void OnPageChanged(wxAuiNotebookEvent& e);
|
||||
long Flags2Style(long flags) const;
|
||||
@ -623,6 +624,7 @@ inline bool VALID_NOTEBOOK(WINDOW notebk, short page_no)
|
||||
BEGIN_EVENT_TABLE(TwxNoteBook, wxAuiNotebook)
|
||||
EVT_AUINOTEBOOK_PAGE_CHANGING(wxID_ANY, TwxNoteBook::OnPageChanging)
|
||||
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, TwxNoteBook::OnPageChanged)
|
||||
EVT_CHAR(TwxNoteBook::OnChar)
|
||||
END_EVENT_TABLE();
|
||||
|
||||
bool TwxNoteBook::SetBackgroundColour(const wxColour& col)
|
||||
@ -637,6 +639,20 @@ bool TwxNoteBook::SetBackgroundColour(const wxColour& col)
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TwxNoteBook::OnChar(wxKeyEvent& evt)
|
||||
{
|
||||
// Ridirige i tasti che non sono certamente di navigazione alla finestra nonna
|
||||
const int kc = evt.GetKeyCode();
|
||||
if (kc >= WXK_F1 && kc <= WXK_F24 || kc == WXK_ESCAPE || kc == WXK_RETURN)
|
||||
{
|
||||
TwxWindow* gp = wxDynamicCast(GetGrandParent(), TwxWindow);
|
||||
if (gp != NULL)
|
||||
gp->ProcessEvent(evt);
|
||||
else
|
||||
evt.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void TwxNoteBook::OnPageChanging(wxAuiNotebookEvent& evt)
|
||||
{
|
||||
if (!m_bSuspended)
|
||||
@ -752,6 +768,14 @@ TwxNoteBook::TwxNoteBook(wxWindow *parent, wxWindowID id,
|
||||
{
|
||||
SetArtProvider(new TwxAuiDefaultTabArt);
|
||||
_nice_windows.Put((WINDOW)this, this); // Serve per poter fare la xvt_vobj_destroy
|
||||
|
||||
wxAuiTabCtrl* atc = GetActiveTabCtrl();
|
||||
if (atc != NULL)
|
||||
#if wxCHECK_VERSION(2,9,0)
|
||||
atc->GetEventHandler().Bind(wxEVT_CHAR, (functor)&TwxNoteBook::OnChar);
|
||||
#else
|
||||
atc->Connect(wxEVT_CHAR, (wxObjectEventFunction)&TwxNoteBook::OnChar);
|
||||
#endif
|
||||
}
|
||||
|
||||
TwxNoteBook::~TwxNoteBook()
|
||||
|
@ -1023,10 +1023,11 @@ void TTaskWin::OnPaint(wxPaintEvent& WXUNUSED(evt))
|
||||
|
||||
XVT_EVENT e(E_UPDATE);
|
||||
RCT& rct = e.v.update.rct;
|
||||
rct.left = rctDamaged.x;
|
||||
rct.left = rctDamaged.x;
|
||||
rct.top = rctDamaged.y;
|
||||
rct.right = rctDamaged.GetRight()+1;
|
||||
rct.bottom = rctDamaged.GetBottom()+1;
|
||||
rct.right = rctDamaged.GetRight();
|
||||
rct.bottom = rctDamaged.GetBottom();
|
||||
xvt_rect_inflate(&rct, 1, 1);
|
||||
|
||||
TDC& dc = GetTDCMapper().GetTDC((WINDOW)this);
|
||||
dc.GetDC(true); // Forza la creazione di un wxPaintDC
|
||||
@ -1037,7 +1038,7 @@ void TTaskWin::OnPaint(wxPaintEvent& WXUNUSED(evt))
|
||||
void TTaskWin::OnSize(wxSizeEvent& evt)
|
||||
{
|
||||
XVT_EVENT e(E_SIZE);
|
||||
e.v.size.width = evt.GetSize().x;
|
||||
e.v.size.width = evt.GetSize().x;
|
||||
e.v.size.height = evt.GetSize().y;
|
||||
_task_win_handler((WINDOW)this, &e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user