Skip to content

Commit

Permalink
minor changes to file open and find
Browse files Browse the repository at this point in the history
  • Loading branch information
alban-read committed May 1, 2021
1 parent 374d4f5 commit 0e3d4fd
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 122 deletions.
Binary file modified Shell.exe
Binary file not shown.
28 changes: 26 additions & 2 deletions scripts/base.scm
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,26 @@
(float float float float) ptr) x y w h)))

(define fill-colour
(lambda (r g b a)
(lambda (r g b a)
((foreign-procedure "d2d_fill_color"
(float float float float) ptr) r g b a)))

(define brush-colour
(lambda (r g b a)
((foreign-procedure "d2d_fill_color"
(float float float float) ptr) r g b a)))

(define add-fill-colour
(lambda (r g b a)
(lambda (r g b a)
((foreign-procedure "add_fill_colour"
(float float float float) ptr) r g b a)))
(define radial-gradient
(lambda (c)
((foreign-procedure "d2d_radial_gradient_color_list"
(ptr) ptr) c)))

(define add-brush-colour
(lambda (r g b a)
((foreign-procedure "add_fill_colour"
(float float float float) ptr) r g b a)))
(define radial-gradient
Expand Down Expand Up @@ -620,10 +634,20 @@
((foreign-procedure "d2d_color"
(float float float float) ptr) r g b a)))

(define pen-colour
(lambda (r g b a)
((foreign-procedure "d2d_color"
(float float float float) ptr) r g b a)))

(define add-line-colour
(lambda (r g b a)
((foreign-procedure "add_line_colour"
(float float float float) ptr) r g b a)))

(define add-pen-colour
(lambda (r g b a)
((foreign-procedure "add_line_colour"
(float float float float) ptr) r g b a)))

(define free-sprites
(lambda ()
Expand Down
Binary file modified scripts/fern.ss
Binary file not shown.
53 changes: 22 additions & 31 deletions src/Mainfrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include "stdafx.h"
#include "mainfrm.h"
#include "Classes.h"
#include "Files.h"
#include "Output.h"
#include "Text.h"
#include "resource.h"
#include "WebViewer.h"
Expand Down Expand Up @@ -48,7 +45,7 @@ void CMainFrame::LoadEvalDockers()
{
const DWORD dw_style = DS_CLIENTEDGE; // The style added to each docker
const auto width = GetWindowRect().Size().cx;
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, width / 2.0, ID_DOCK_TEXT1);
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 2.0), ID_DOCK_TEXT1);
in->AddDockedChild(new CDockResponseText, DS_DOCKED_BOTTOM | dw_style, 200, ID_DOCK_TEXT3);
AddDockedChild(new CDockTranscriptText, DS_DOCKED_LEFT | DS_DOCKED_RIGHT | dw_style, 200, ID_DOCK_TEXT2);

Expand All @@ -59,9 +56,9 @@ void CMainFrame::LoadDefaultDockers()
{
const DWORD dw_style = DS_CLIENTEDGE; // The style added to each docker
const auto width = GetWindowRect().Size().cx;
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, width / 2.2, ID_DOCK_TEXT1);
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 2.0), ID_DOCK_TEXT1);
in->AddDockedChild(new CDockResponseText, DS_DOCKED_BOTTOM | dw_style, 200, ID_DOCK_TEXT3);
auto im = AddDockedChild(new CDockImage, DS_DOCKED_LEFT | DS_DOCKED_RIGHT | dw_style, width / 3, ID_DOCK_IMAGE1);
auto im = AddDockedChild(new CDockImage, DS_DOCKED_LEFT | DS_DOCKED_RIGHT | dw_style, static_cast<int>(width / 2.0), ID_DOCK_IMAGE1);
im->AddDockedChild(new CDockTranscriptText, DS_DOCKED_BOTTOM | dw_style, 200, ID_DOCK_TEXT2);

}
Expand All @@ -70,11 +67,11 @@ void CMainFrame::load_browser_dockers()
{
const auto width = GetWindowRect().Size().cx;
const DWORD dw_style = DS_CLIENTEDGE; // The style added to each docker
AddDockedChild(new CDockWebViewer, DS_DOCKED_LEFT | dw_style, width / 3, ID_DOCK_BROWSER1);
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, width / 3, ID_DOCK_TEXT1);
AddDockedChild(new CDockWebViewer, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 3), ID_DOCK_BROWSER1);
auto in = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 3), ID_DOCK_TEXT1);
in->AddDockedChild(new CDockResponseText, DS_DOCKED_BOTTOM | dw_style, 200, ID_DOCK_TEXT3);
auto im = AddDockedChild(new CDockImage, DS_DOCKED_LEFT | DS_DOCKED_RIGHT | dw_style, width / 3, ID_DOCK_IMAGE1);
im->AddDockedChild(new CDockTranscriptText, DS_DOCKED_CONTAINER | dw_style, width / 3, ID_DOCK_TEXT2);
auto im = AddDockedChild(new CDockImage, DS_DOCKED_LEFT | DS_DOCKED_RIGHT | dw_style, static_cast<int>(width / 3), ID_DOCK_IMAGE1);
im->AddDockedChild(new CDockTranscriptText, DS_DOCKED_CONTAINER | dw_style, static_cast<int>(width / 3), ID_DOCK_TEXT2);

}

Expand All @@ -83,22 +80,22 @@ void CMainFrame::load_browser_image_dockers()
{
const auto width = GetWindowRect().Size().cx;
const DWORD dw_style = DS_CLIENTEDGE; // The style added to each docker
input=AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, width / 3, ID_DOCK_TEXT1);
input=AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 3), ID_DOCK_TEXT1);
input->AddDockedChild(new CDockResponseText, DS_DOCKED_CONTAINER | dw_style, 200, ID_DOCK_TEXT3);
input->AddDockedChild(new CDockTranscriptText, DS_DOCKED_CONTAINER | dw_style, 200, ID_DOCK_TEXT2);
image=AddDockedChild(new CDockImage, DS_DOCKED_TOP | DS_DOCKED_RIGHT | dw_style, width / 3, ID_DOCK_IMAGE1);
browser=input->AddDockedChild(new CDockWebViewer, DS_DOCKED_CONTAINER | dw_style, width / 3, ID_DOCK_BROWSER1);
image=AddDockedChild(new CDockImage, DS_DOCKED_TOP | DS_DOCKED_RIGHT | dw_style, static_cast<int>(width / 3), ID_DOCK_IMAGE1);
browser=input->AddDockedChild(new CDockWebViewer, DS_DOCKED_CONTAINER | dw_style, static_cast<int>(width / 3), ID_DOCK_BROWSER1);

}

void CMainFrame::load_image_dockers()
{
const auto width = GetWindowRect().Size().cx;
const DWORD dw_style = DS_CLIENTEDGE; // The style added to each docker
input = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, width / 3, ID_DOCK_TEXT1);
input = AddDockedChild(new CDockText, DS_DOCKED_LEFT | dw_style, static_cast<int>(width / 3), ID_DOCK_TEXT1);
auto x=AddDockedChild(new CDockResponseText, DS_DOCKED_BOTTOM | dw_style, 160, ID_DOCK_TEXT3);
x->AddDockedChild(new CDockTranscriptText, DS_DOCKED_RIGHT | dw_style, 160, ID_DOCK_TEXT2);
AddDockedChild(new CDockImage, DS_DOCKED_TOP | DS_DOCKED_RIGHT | dw_style, width / 3, ID_DOCK_IMAGE1);
AddDockedChild(new CDockImage, DS_DOCKED_TOP | DS_DOCKED_RIGHT | dw_style, static_cast<int>(width / 3), ID_DOCK_IMAGE1);

}

Expand All @@ -109,7 +106,7 @@ void CMainFrame::load_full_image_dockers()

CDocker* CMainFrame::NewDockerFromID(int id)
{
CDocker* pDock = NULL;
CDocker* pDock = nullptr;
switch (id)
{
case ID_DOCK_TEXT1:
Expand Down Expand Up @@ -589,27 +586,20 @@ void CMainFrame::SetupToolBar()

LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{

LPFINDREPLACE lpfr;

if (uMsg == uFindReplaceMsg)
{

lpfr = (LPFINDREPLACE)lParam;


if (lpfr->Flags & FR_DIALOGTERM)
const auto finder = reinterpret_cast<LPFINDREPLACE>(lParam);
if (finder->Flags & FR_DIALOGTERM)
{
file_find_hdlg = NULL;
file_find_hdlg = nullptr;
CViewText::ResetSearch();
return 0;
}


if (lpfr->Flags & FR_FINDNEXT)
if (finder->Flags & FR_FINDNEXT)
{
CViewText::SetSearchFlags(lpfr->Flags);
CViewText::Search(lpfr->lpstrFindWhat);
CViewText::SetSearchFlags(finder->Flags);
std::wstring find_this = finder->lpstrFindWhat;
CViewText::Search(find_this);
}

return 0;
Expand All @@ -620,7 +610,7 @@ LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)

case WM_USER + 500:
{
SetStatusText((int)wParam, (LPCTSTR)lParam);
SetStatusText(static_cast<int>(wParam), reinterpret_cast<LPCTSTR>(lParam));
break;
}
case WM_USER + 501:
Expand All @@ -633,6 +623,7 @@ LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
const int count = DragQueryFile(reinterpret_cast<HDROP>(wParam), 0xFFFFFFFF, nullptr, 0);
if (count == 0) { return TRUE; }

auto index = 0;
const auto buffer = new char[64000];

Expand Down
Loading

0 comments on commit 0e3d4fd

Please sign in to comment.