mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-19 14:22:42 -06:00
Ole: some fixes
git-svn-id: svn://ultimatepp.org/upp/trunk@15667 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ebe9329c2b
commit
ee6ba69e44
5 changed files with 20 additions and 17 deletions
|
|
@ -618,10 +618,10 @@ public:
|
|||
|
||||
// IViewObject
|
||||
|
||||
STDMETHOD(Draw)(dword aspect, long index, void *aspectinfo,
|
||||
STDMETHOD(Draw)(DWORD aspect, LONG index, void *aspectinfo,
|
||||
DVTARGETDEVICE *device, HDC target, HDC draw,
|
||||
const RECTL *bounds, const RECTL *wbounds,
|
||||
BOOL (STDMETHODCALLTYPE *progress)(dword arg), dword arg);
|
||||
BOOL (STDMETHODCALLTYPE *progress)(ULONG_PTR dwContinue), ULONG_PTR arg);
|
||||
STDMETHOD(GetColorSet)(dword aspect, long index, void *aspectinfo,
|
||||
DVTARGETDEVICE *device, HDC target, LOGPALETTE **palette);
|
||||
STDMETHOD(Freeze)(dword aspect, long index, void *aspectinfo,
|
||||
|
|
|
|||
|
|
@ -527,10 +527,10 @@ HRESULT OcxControl::EnumDAdvise(IEnumSTATDATA **enumerator)
|
|||
return LOGRESULT(E_NOTIMPL);
|
||||
}
|
||||
|
||||
HRESULT OcxControl::Draw(dword aspect, long index, void *aspectinfo,
|
||||
DVTARGETDEVICE *device, HDC target_dc, HDC draw_dc,
|
||||
const RECTL *bounds, const RECTL *wbounds,
|
||||
BOOL (STDMETHODCALLTYPE *progress)(dword arg), dword arg)
|
||||
HRESULT OcxControl::Draw(DWORD aspect, LONG index, void *aspectinfo,
|
||||
DVTARGETDEVICE *device, HDC target, HDC draw_dc,
|
||||
const RECTL *bounds, const RECTL *wbounds,
|
||||
BOOL (STDMETHODCALLTYPE *progress)(ULONG_PTR dwContinue), ULONG_PTR arg)
|
||||
{
|
||||
LOGMETHOD("IViewObject::Draw");
|
||||
if(aspect != DVASPECT_CONTENT)
|
||||
|
|
@ -743,15 +743,15 @@ HRESULT OcxControl::TranslateAccelerator(MSG *msg)
|
|||
LOGMETHOD("IOleInPlaceObject::TranslateAccelerator");
|
||||
dword keycode = 0;
|
||||
if(msg->message == WM_KEYDOWN)
|
||||
keycode = KEYtoK(msg->wParam);
|
||||
keycode = KEYtoK((dword)msg->wParam);
|
||||
else if(msg->message == WM_KEYUP)
|
||||
keycode = KEYtoK(msg->wParam) | K_KEYUP;
|
||||
keycode = KEYtoK((dword)msg->wParam) | K_KEYUP;
|
||||
else if(msg->message == WM_SYSKEYDOWN && (msg->lParam & 0x20000000))
|
||||
keycode = KEYtoK(msg->wParam);
|
||||
keycode = KEYtoK((dword)msg->wParam);
|
||||
else if(msg->message == WM_SYSKEYUP && (msg->lParam & 0x20000000))
|
||||
keycode = KEYtoK(msg->wParam) | K_KEYUP;
|
||||
keycode = KEYtoK((dword)msg->wParam) | K_KEYUP;
|
||||
else if(msg->message == WM_CHAR)
|
||||
keycode = msg->wParam;
|
||||
keycode = (dword)msg->wParam;
|
||||
if(keycode == 0 || !IsActive() || !IsEnabled() || !IsVisible())
|
||||
return LOGRESULT(S_FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ GUID GetCoClassGUID(const char *name, bool prog_id)
|
|||
return guid;
|
||||
}
|
||||
|
||||
unsigned GetHashValue(const GUID& guid) {
|
||||
hash_t GetHashValue(const GUID& guid) {
|
||||
const dword *p = reinterpret_cast<const dword *>(&guid);
|
||||
return CombineHash(p[0], p[1], p[2], p[3]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ private:
|
|||
T *ptr;
|
||||
};
|
||||
|
||||
unsigned GetHashValue(const GUID& guid);
|
||||
hash_t GetHashValue(const GUID& guid);
|
||||
String Format(const GUID& guid);
|
||||
String CFormat(const GUID& guid);
|
||||
inline void Serialize(Stream& stream, GUID& guid) { stream.SerializeRaw((byte *)&guid, sizeof(GUID)); }
|
||||
|
|
@ -74,7 +74,7 @@ private:
|
|||
};
|
||||
|
||||
template <>
|
||||
inline unsigned GetHashValue(const Guid& guid) { return GetHashValue(~guid); }
|
||||
inline hash_t GetHashValue(const Guid& guid) { return GetHashValue(~guid); }
|
||||
template <>
|
||||
inline String AsString(const GUID& guid) { return Format(guid); }
|
||||
template <>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ struct UppHubNest : Moveable<UppHubNest> {
|
|||
int tier = -1;
|
||||
String name;
|
||||
Vector<String> packages;
|
||||
Vector<String> uses;
|
||||
String description;
|
||||
String repo;
|
||||
String status = "unknown";
|
||||
|
|
@ -47,6 +48,7 @@ UppHubDlg::UppHubDlg()
|
|||
|
||||
list.AddIndex("REPO");
|
||||
list.AddIndex("README");
|
||||
list.AddIndex("USES");
|
||||
|
||||
list.ColumnWidths("94 72 373 251 119 53");
|
||||
list.WhenSel = [=] {
|
||||
|
|
@ -139,12 +141,15 @@ void UppHubDlg::Load(int tier, const String& url, bool deep)
|
|||
String list_name = v["name"];
|
||||
for(Value ns : v["nests"]) {
|
||||
String name = ns["name"];
|
||||
UppHubNest& n = upv.GetAdd(ns["name"]);
|
||||
UppHubNest& n = upv.GetAdd(name);
|
||||
n.name = name;
|
||||
bool tt = tier > n.tier;
|
||||
if(tt || n.packages.GetCount() == 0)
|
||||
for(Value p : ns["packages"])
|
||||
n.packages.Add(p);
|
||||
if(tt || n.uses.GetCount() == 0)
|
||||
for(Value p : ns["uses"])
|
||||
n.uses.Add(p);
|
||||
auto Attr = [&](String& a, const char *id) {
|
||||
if(tt || IsNull(a))
|
||||
a = ns[id];
|
||||
|
|
@ -234,8 +239,6 @@ void UppHubDlg::Install(bool noprompt)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void UppHubDlg::Uninstall(bool noprompt)
|
||||
{
|
||||
if(list.IsCursor() && (noprompt || PromptYesNo("Uninstall " + ~list.GetKey() + "?"))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue