diff options
-rw-r--r-- | plugins/HistoryPlusPlus/historypp.dproj | 2 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_external.pas | 230 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_externalgrid.pas | 7 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 7 | ||||
-rw-r--r-- | src/mir_app/src/srmm_log_hpp.cpp | 2 |
7 files changed, 112 insertions, 145 deletions
diff --git a/plugins/HistoryPlusPlus/historypp.dproj b/plugins/HistoryPlusPlus/historypp.dproj index dac7decafd..dba6d42d27 100644 --- a/plugins/HistoryPlusPlus/historypp.dproj +++ b/plugins/HistoryPlusPlus/historypp.dproj @@ -8,7 +8,7 @@ <AppType>Library</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>13.4</ProjectVersion>
- <Platform Condition="'$(Platform)'==''">Win32</Platform>
+ <Platform Condition="'$(Platform)'==''">Win64</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
diff --git a/plugins/HistoryPlusPlus/hpp_external.pas b/plugins/HistoryPlusPlus/hpp_external.pas index cb81d72363..9c3dbb8ed7 100644 --- a/plugins/HistoryPlusPlus/hpp_external.pas +++ b/plugins/HistoryPlusPlus/hpp_external.pas @@ -67,76 +67,60 @@ uses var
hExtOptChanged: THandle;
-function _ExtWindow(wParam:WPARAM; lParam: LPARAM): uint_ptr;
+function ExtWindowNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
var
par: PIEVIEWWINDOW;
ExtGrid: TExternalGrid;
- ControlID: Cardinal;
begin
Result := 0;
- //try
- par := PIEVIEWWINDOW(lParam);
- Assert(par <> nil, 'Empty IEVIEWWINDOW structure');
- case par.iType of
- IEW_CREATE: begin
- {$IFDEF DEBUG}
- OutputDebugString('IEW_CREATE');
- {$ENDIF}
- case par.dwMode of
- IEWM_TABSRMM: ControlID := 1006; // IDC_LOG from tabSRMM
- IEWM_SCRIVER: ControlID := 1001; // IDC_LOG from Scriver
- IEWM_MUCC: ControlID := 0;
- IEWM_CHAT: ControlID := 0;
- IEWM_HISTORY: ControlID := 0;
- else ControlID := 0;
- end;
- ExtGrid := TExternalGrid.Create(par.Parent,ControlID);
- case par.dwMode of
- IEWM_MUCC,IEWM_CHAT: begin
- ExtGrid.ShowHeaders := False;
- ExtGrid.GroupLinked := False;
- ExtGrid.ShowBookmarks := False;
- end;
- IEWM_HISTORY:
- ExtGrid.GroupLinked := False;
+
+ par := PIEVIEWWINDOW(lParam);
+ Assert(par <> nil, 'Empty IEVIEWWINDOW structure');
+ case par.iType of
+ IEW_CREATE: begin
+ {$IFDEF DEBUG}
+ OutputDebugString('IEW_CREATE');
+ {$ENDIF}
+ ExtGrid := TExternalGrid.Create(par.Parent);
+ case par.dwMode of
+ IEWM_MUCC,IEWM_CHAT: begin
+ ExtGrid.ShowHeaders := False;
+ ExtGrid.GroupLinked := False;
+ ExtGrid.ShowBookmarks := False;
end;
- ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy);
- ExternalGrids.Add(ExtGrid);
- par.Hwnd := ExtGrid.GridHandle;
- end;
- IEW_DESTROY: begin
- {$IFDEF DEBUG}
- OutputDebugString('IEW_DESTROY');
- {$ENDIF}
- ExternalGrids.Delete(par.Hwnd);
- end;
- IEW_SETPOS: begin
- {$IFDEF DEBUG}
- OutputDebugString('IEW_SETPOS');
- {$ENDIF}
- ExtGrid := ExternalGrids.Find(par.Hwnd);
- if ExtGrid <> nil then
- ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy);
- end;
- IEW_SCROLLBOTTOM: begin
- {$IFDEF DEBUG}
- OutputDebugString('IEW_SCROLLBOTTOM');
- {$ENDIF}
- ExtGrid := ExternalGrids.Find(par.Hwnd);
- if ExtGrid <> nil then
- ExtGrid.ScrollToBottom;
+ IEWM_HISTORY:
+ ExtGrid.GroupLinked := False;
end;
+ ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy);
+ ExternalGrids.Add(ExtGrid);
+ par.Hwnd := ExtGrid.GridHandle;
end;
- //except
- //end;
-end;
-
-function ExtWindowNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
-begin
- Result := _ExtWindow(wParam,lParam);
+ IEW_DESTROY: begin
+ {$IFDEF DEBUG}
+ OutputDebugString('IEW_DESTROY');
+ {$ENDIF}
+ ExternalGrids.Delete(par.Hwnd);
+ end;
+ IEW_SETPOS: begin
+ {$IFDEF DEBUG}
+ OutputDebugString('IEW_SETPOS');
+ {$ENDIF}
+ ExtGrid := ExternalGrids.Find(par.Hwnd);
+ if ExtGrid <> nil then
+ ExtGrid.SetPosition(par.x,par.y,par.cx,par.cy);
+ end;
+ IEW_SCROLLBOTTOM: begin
+ {$IFDEF DEBUG}
+ OutputDebugString('IEW_SCROLLBOTTOM');
+ {$ENDIF}
+ ExtGrid := ExternalGrids.Find(par.Hwnd);
+ if ExtGrid <> nil then
+ ExtGrid.ScrollToBottom;
+ end;
+ end;
end;
-function _ExtEvent(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
+function ExtEventNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
var
event: PIEVIEWEVENT;
customEvent: PIEVIEWEVENTDATA;
@@ -147,79 +131,71 @@ var CustomItem: TExtCustomItem;
begin
Result := 0;
- //try
- {$IFDEF DEBUG}
- OutputDebugString('MS_IEVIEW_EVENT');
- {$ENDIF}
- event := PIEVIEWEVENT(lParam);
- Assert(event <> nil, 'Empty IEVIEWEVENT structure');
- ExtGrid := ExternalGrids.Find(event.Hwnd);
- if ExtGrid = nil then exit;
- case event.iType of
- IEE_LOG_DB_EVENTS: begin
- UsedCodepage := event.Codepage;
- eventCount := event.Count;
- hDBNext := event.Event.hDBEventFirst;
- ExtGrid.BeginUpdate;
- while (eventCount <> 0) and (hDBNext <> 0) do
- begin
- ExtGrid.AddEvent(event.hContact, hDBNext, UsedCodepage,
+
+ {$IFDEF DEBUG}
+ OutputDebugString('MS_IEVIEW_EVENT');
+ {$ENDIF}
+ event := PIEVIEWEVENT(lParam);
+ Assert(event <> nil, 'Empty IEVIEWEVENT structure');
+ ExtGrid := ExternalGrids.Find(event.Hwnd);
+ if ExtGrid = nil then exit;
+ case event.iType of
+ IEE_LOG_DB_EVENTS: begin
+ UsedCodepage := event.Codepage;
+ eventCount := event.Count;
+ hDBNext := event.Event.hDBEventFirst;
+ ExtGrid.BeginUpdate;
+ while (eventCount <> 0) and (hDBNext <> 0) do
+ begin
+ ExtGrid.AddEvent(event.hContact, hDBNext, UsedCodepage,
+ boolean(event.dwFlags and IEEF_RTL),
+ not boolean(event.dwFlags and IEEF_NO_SCROLLING));
+ if eventCount > 0 then Dec(eventCount);
+ if eventCount <> 0 then
+ hDBNext := db_event_next(event.hContact,hDBNext);
+ end;
+ ExtGrid.EndUpdate;
+ end;
+ IEE_LOG_MEM_EVENTS: begin
+ UsedCodepage := event.Codepage;
+ eventCount := event.Count;
+ customEvent := event.Event.eventData;
+ ExtGrid.BeginUpdate;
+ while (eventCount <> 0) and (customEvent <> nil) do
+ begin
+ if boolean(customEvent.dwFlags and IEEDF_UNICODE_TEXT) then
+ SetString(CustomItem.Text,customEvent.Text.w,lstrlenW(customEvent.Text.w))
+ else
+ CustomItem.Text := AnsiToWideString(AnsiString(customEvent.Text.a),UsedCodepage);
+ if boolean(customEvent.dwFlags and IEEDF_UNICODE_NICK) then
+ SetString(CustomItem.Nick,customEvent.Nick.w,lstrlenW(customEvent.Nick.w))
+ else
+ CustomItem.Nick := AnsiToWideString(AnsiString(customEvent.Nick.a),UsedCodepage);
+ CustomItem.Sent := boolean(customEvent.bIsMe);
+ CustomItem.Time := customEvent.time;
+ CustomItem.hEvent := customEvent.hEvent;
+ ExtGrid.AddCustomEvent(event.hContact, CustomItem, UsedCodepage,
boolean(event.dwFlags and IEEF_RTL),
not boolean(event.dwFlags and IEEF_NO_SCROLLING));
- if eventCount > 0 then Dec(eventCount);
- if eventCount <> 0 then
- hDBNext := db_event_next(event.hContact,hDBNext);
- end;
- ExtGrid.EndUpdate;
- end;
- IEE_LOG_MEM_EVENTS: begin
- UsedCodepage := event.Codepage;
- eventCount := event.Count;
- customEvent := event.Event.eventData;
- ExtGrid.BeginUpdate;
- while (eventCount <> 0) and (customEvent <> nil) do
- begin
- if boolean(customEvent.dwFlags and IEEDF_UNICODE_TEXT) then
- SetString(CustomItem.Text,customEvent.Text.w,lstrlenW(customEvent.Text.w))
- else
- CustomItem.Text := AnsiToWideString(AnsiString(customEvent.Text.a),UsedCodepage);
- if boolean(customEvent.dwFlags and IEEDF_UNICODE_NICK) then
- SetString(CustomItem.Nick,customEvent.Nick.w,lstrlenW(customEvent.Nick.w))
- else
- CustomItem.Nick := AnsiToWideString(AnsiString(customEvent.Nick.a),UsedCodepage);
- CustomItem.Sent := boolean(customEvent.bIsMe);
- CustomItem.Time := customEvent.time;
- CustomItem.hEvent := customEvent.hEvent;
- ExtGrid.AddCustomEvent(event.hContact, CustomItem, UsedCodepage,
- boolean(event.dwFlags and IEEF_RTL),
- not boolean(event.dwFlags and IEEF_NO_SCROLLING));
- if eventCount > 0 then Dec(eventCount);
- customEvent := customEvent.next;
- end;
- ExtGrid.EndUpdate;
- end;
- IEE_CLEAR_LOG: begin
- ExtGrid.BeginUpdate;
- ExtGrid.Clear;
- ExtGrid.EndUpdate;
- end;
- IEE_GET_SELECTION: begin
- Result := uint_ptr(ExtGrid.GetSelection());
- end;
- IEE_SAVE_DOCUMENT: begin
- ExtGrid.SaveSelected;
+ if eventCount > 0 then Dec(eventCount);
+ customEvent := customEvent.next;
end;
+ ExtGrid.EndUpdate;
end;
- //except
- //end;
-end;
-
-function ExtEventNative(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
-begin
- Result := _ExtEvent(wParam,lParam);
+ IEE_CLEAR_LOG: begin
+ ExtGrid.BeginUpdate;
+ ExtGrid.Clear;
+ ExtGrid.EndUpdate;
+ end;
+ IEE_GET_SELECTION: begin
+ Result := uint_ptr(ExtGrid.GetSelection());
+ end;
+ IEE_SAVE_DOCUMENT: begin
+ ExtGrid.SaveSelected;
+ end;
+ end;
end;
-
function ExtNavigate(wParam:WPARAM; lParam: LPARAM): uint_ptr; cdecl;
begin
Result := 0;
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index 364e3b0331..ce87e08aef 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -458,7 +458,6 @@ begin TranslateMenu(pmLink.Items);
CreateEventsFilterMenu;
- // SetEventFilter(GetDBInt(hppDBName,'RecentLogFilter',GetShowAllEventsIndex));
SetEventFilter(GetShowAllEventsIndex);
end;
@@ -693,11 +692,6 @@ begin end;
end;
-// procedure TExternalGrid.HMIcons2Changed(var M: TMessage);
-// begin
-// Grid.Repaint;
-// end;
-
procedure TExternalGrid.GridSelectRequest(Sender: TObject);
begin
if (Grid.Selected <> -1) and Grid.IsVisible(Grid.Selected) then
@@ -1214,7 +1208,6 @@ end; procedure TExternalGrid.GridMCData(Sender: TObject; Index: Integer; var Item: TMCItem; Stage: TSaveStage);
var
DBEventInfo: TOldDBEventInfo;
- dbei : TDBEventInfo;
hDBEvent: THandle;
DataOffset: PAnsiChar;
TextUTF: Utf8String;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 11065a5733..b131ac952c 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1079,8 +1079,7 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) int iSplitterX = m_pContainer->cfg.iSplitterX;
- RECT rc, rcButton;
- GetClientRect(m_pLog->GetHwnd(), &rc);
+ RECT rcButton;
GetClientRect(GetDlgItem(m_hwnd, IDC_PROTOCOL), &rcButton);
if (m_bIsAutosizingInput)
@@ -1183,6 +1182,7 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
case IDC_CONTACTPIC:
+ RECT rc;
GetClientRect(m_message.GetHwnd(), &rc);
urc->rcItem.top -= m_iSplitterY - m_originalSplitterY;
urc->rcItem.left = urc->rcItem.right - (m_pic.cx + 2);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 492af0aede..11bdbd1978 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -573,11 +573,10 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) m_btnChannelMgr.Enable(m_si->pMI->bChanMgr);
}
}
- else {
- SetupStatusBar();
- }
+ else SetupStatusBar();
CSuper::DlgProc(uMsg, wParam, lParam); // call built-in resizer
+ m_pLog->Resize();
SetButtonsPos();
}
return TRUE;
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index abf909314a..92015295b7 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -486,12 +486,11 @@ bool CSrmmBaseDialog::OnInitDialog() SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
m_pLog = Srmm_GetLogWindow((CMsgDialog*)this);
+ m_pLog->Attach();
if (m_pLog->GetType() != 0) { // custom log type
- HWND hwndLog = GetDlgItem(m_hwnd, IDC_SRMM_LOG);
- EnableWindow(hwndLog, FALSE);
- ShowWindow(hwndLog, SW_HIDE);
+ DestroyWindow(GetDlgItem(m_hwnd, IDC_SRMM_LOG));
+ SetWindowLong(m_pLog->GetHwnd(), GWLP_ID, IDC_SRMM_LOG);
}
- m_pLog->Attach();
SetWindowLongPtr(m_message.GetHwnd(), GWLP_USERDATA, LPARAM(this));
mir_subclassWindow(m_message.GetHwnd(), stubMessageProc);
diff --git a/src/mir_app/src/srmm_log_hpp.cpp b/src/mir_app/src/srmm_log_hpp.cpp index 969200d093..9a70d495a7 100644 --- a/src/mir_app/src/srmm_log_hpp.cpp +++ b/src/mir_app/src/srmm_log_hpp.cpp @@ -198,7 +198,7 @@ public: IEVIEWWINDOW ieWindow = { sizeof(ieWindow) };
ieWindow.iType = IEW_SETPOS;
- ieWindow.parent = m_hwnd;
+ ieWindow.parent = m_pDlg.GetHwnd();
ieWindow.hwnd = m_hwnd;
ieWindow.x = pt.x;
ieWindow.y = pt.y;
|