PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 ... 10
 31 
 on: April 01, 2020, 06:46:48 PM 
Started by ji_vildaasen - Last post by Paul Squires
Hi,

Attached is a project that emulates the code that you posted. I had to modify the child form's styles in its Load event. I have also attached a screenshot of the running program.

 32 
 on: April 01, 2020, 06:02:30 PM 
Started by SeaVipe - Last post by Paul Squires
All finished and works great with ansi and unicode. Entire new code is about 200 lines thanks to Jose's functions. The searching is also very fast and takes into account unicode Form files that have form meta data and code generation at the start of their files (those lines are bypassed when doing the search). This is actually something that I would not have been able to do should I have opted to use an external grep type of program.

 33 
 on: April 01, 2020, 12:58:39 PM 
Started by Paul Squires - Last post by Paul Squires
Hi Joerg, thanks for the updated file! Appreciate it.
Hope you stay safe as well!

 34 
 on: April 01, 2020, 10:49:47 AM 
Started by Paul Squires - Last post by Joerg Buckel
Hello Paul
Thanks for the current version.

I have attached the current German language file again.

off topic:

Keep your distance and use the possibility of hand disinfection.
I hope you all stay healthy.

With this in mind.

 35 
 on: April 01, 2020, 08:26:06 AM 
Started by SeaVipe - Last post by Paul Squires
I've settled on writing my own and it has been incredibly easy so far. With the use of Jose's CFindFile and CTextStream classes, this is almost too easy. Once again, if you are not using Jose's WinFBX library in your coding then you are missing out on a HUGE productivity advantage.

 36 
 on: March 31, 2020, 06:25:17 PM 
Started by ji_vildaasen - Last post by ji_vildaasen
When I try this, I get a child window placed on the main window(which is probably what most would want). I'm trying to create a movable child window like in this code(that follows and clips to the main window):

Quote

#define UNICODE
#INCLUDE ONCE "Afx\CWindow.inc"
USING Afx

declare FUNCTION MainWindow_WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
declare FUNCTION ToolWindow_WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

Dim shared MainWindow as CWindow
Dim shared ToolWindow as CWindow


' // Set process DPI aware
   AfxSetProcessDPIAware


   dim AS UINT dwStyle, dwExStyle

' Init Main Window
   dwStyle = WS_VISIBLE or WS_OVERLAPPEDWINDOW
   dwExStyle = 0

   MainWindow.Create(NULL, "Main", @MainWindow_WndProc, 50, 50, 1000, 800, dwStyle, dwExStyle)
   MainWindow.Brush = CreateSolidBrush(BGR(92, 92, 92))
   UpdateWindow MainWindow.hWindow


' Init ToolWindow
   dwStyle = WS_HSCROLL or WS_VSCROLL or WS_CHILD or WS_VISIBLE or WS_CAPTION
   dwExStyle = WS_EX_TOOLWINDOW

   ToolWindow.Create(MainWindow.hWindow, "Tool", @ToolWindow_WndProc, 300, 200, 500, 500, dwStyle, dwExStyle)
   ToolWindow.Brush = CreateSolidBrush(BGR(250, 250, 250))
   UpdateWindow ToolWindow.hWindow


   DIM uMsg AS MSG

' // Message loop
   WHILE .GetMessageW(@uMsg, NULL, 0, 0)

      ' // Processes accelerator keys for menu commands
      IF MainWindow.AccelHandle = NULL OR .TranslateAcceleratorW(MainWindow.hWindow, MainWindow.AccelHandle, @uMsg) = 0 THEN
      ' // Translates virtual-key messages into character messages.
         .TranslateMessage @uMsg
      ' // Dispatches a message to a window procedure.
         .DispatchMessageW @uMsg
      END IF

   WEND

'____________________________________________________________________________________________________
FUNCTION MainWindow_WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

   SELECT CASE uMsg

      CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            CASE IDCANCEL
               ' // If ESC key pressed, close the application by sending an WM_CLOSE message
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  SendMessageW hwnd, WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
         END SELECT

       CASE WM_DESTROY
         ' // End the application
         PostQuitMessage(0)
         EXIT FUNCTION

   END SELECT

   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)

END FUNCTION

'____________________________________________________________________________________________________
FUNCTION ToolWindow_WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

   SELECT CASE uMsg
   CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            CASE IDCANCEL
         END SELECT

   CASE WM_DESTROY
      EXIT FUNCTION

   END SELECT

   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)

END FUNCTION

 37 
 on: March 31, 2020, 03:00:05 PM 
Started by ji_vildaasen - Last post by Paul Squires
You set the "ChildForm" property to TRUE for frmTool1 and then display it as a child frmMain

Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   frmTool1.ShowChild( frmMain )
   Function = 0
End Function

The overload error occurs because Parent is not defined as an object but rather a pointer (because of some limitations with FB's ByRef).
The following two syntaxes should work:
   frmTool1.Parent = @frmMain
   frmTool1.hWindowParent= frmMain.hWindow

I don't think I built into the designer a way to add default scrollbars. I'll put that on my To Do list.


 38 
 on: March 31, 2020, 02:16:08 PM 
Started by ji_vildaasen - Last post by ji_vildaasen
Thank you, that was easy =)

Is it also possible to add the default scrollbars with WS_HSCROLL / WS_VSCROLL on a window in the designer? I tried to make the Toolwindow a child window, but that didn't change anything, like when adding "WS_CHILD" will make the tool windows position relative to the parent window(plus clip the child window to the size of the parent).

Also before seeing your code, I tried:
Quote
frmTool1.Parent = frmMain.hWindow
frmTool1.Show
But this gives a compiler error for "No matching overload...Parent()". Should this have worked?

 39 
 on: March 31, 2020, 01:12:40 PM 
Started by Bruce Huber - Last post by SeaVipe
Maybe a user defined location for snippets and themes?

 40 
 on: March 31, 2020, 11:46:43 AM 
Started by SeaVipe - Last post by Paul Squires
Looks like there are lots of command line greps available. I'll just take some time and find a suitable one.

Pages: 1 2 3 [4] 5 6 ... 10