PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8 9 [10]
 91 
 on: November 12, 2018, 04:15:46 PM 
Started by Johan Klassen - Last post by Johan Klassen
hello Paul :-)
found the following code at https://www.freebasic.net/forum/viewtopic.php?p=138367#p138367
made a new project with one button and placed the code in the Form1_Button1_Click function.
everything seems to work OK but I would like your opinion, is the code kosher?
are there any memory leaks?
is there a better way?

[I changed hWndForm to Form1.hWindow]
Code: [Select]
Function Form1_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
 'by BasicScience

 Dim As Integer xleft, ytop, wd, ht
 xleft = 50
 ytop = 50
 wd = 400
 ht = 200
 Dim hDC As HDC
' Dim hPen As hpen
                           
   hDC = GetDC( Form1.hWindow )
   
   
   Rectangle hDC, xleft, ytop, xleft+wd, ytop+ht
   Dim As HPEN greenPen=CreatePen(PS_solid, 3, &h0000ff00)
   Dim As HPEN BluePen=CreatePen(PS_solid, 3, &h00ff0000)
   SelectObject (hDC, greenPen)
   
   MoveToEx hDC, xleft, ytop+ht/2, Null
   For i As Integer = 0 To wd-1
   
        If i = wd/2 Then   SelectObject (hDC, BluePen)
         LineTo hDC, xleft+i, ytop + (ht/2)*(1+ Sin(6.28*i/20)*Exp(-i/70))

   Next i
   
   ReleaseDC Form1.hWindow, hDC     

  DeleteObject(GreenPen)
  DeleteObject(BluePen)
   Function = 0
End Function

 92 
 on: November 12, 2018, 01:57:05 PM 
Started by Paul Squires - Last post by SeaVipe
Thanks, Paul,

ComboBox:
KeyDown fires Click and KeyDown,
Nothing fires TextChanged

Off topic. Where should this line go: "frmMain.ShowInTaskBar = True" I've placed it just about everywhere and it does not appear to make any difference, the form is only shown in the TaskBar by ALT/Tabbing to it. Once selected, the form remains in the TaskBar until the program ends.

 93 
 on: November 12, 2018, 11:09:58 AM 
Started by Paul Squires - Last post by Paul Squires
Hi Clive, thanks for the report. This one took me awhile to figure out. There was a bit of a 'chicken and egg' problem happening when code was deleted and then a compile took place. No checks were there to regenerate the missing code therefore DECLARE were generated for now non-existing Functions. I am pretty sure that I have that problem corrected now. I will upload new package later today.

 94 
 on: November 11, 2018, 04:03:34 PM 
Started by Paul Squires - Last post by SeaVipe
Paul, in looking to duplicate the hourglass pointer I came across the following:

I removed Check1 checkbox from frmMain (the sample code you posted a few days ago) and removed the 3 events associated with it then attempted a compile. Image4 is the result - Linking Failed...


Image4 also shows Combo1 Click Event in the function list.

I then closed and restarted WinFBE and attempted a compile. Image5 is the result, where the function list correctly shows Check1 missing BUT also Combo1 - which was not removed and should still be there.


Image6 shows Combo1 in the Designer which has not been edited for many successful compiles.


Unchecking the Combo1 Click Event and rechecking it added the Click Event code back into frmMain but without its original code of course.


I seldom use folding but it's used here just so all of the functions in frmMain can be seen on 1 screen.


I hope you find this understandable and helpful.

 95 
 on: November 11, 2018, 02:22:17 PM 
Started by Paul Squires - Last post by SeaVipe
Will do. I'll keep an eye on it as it is not something I have been able to duplicate, it just happens periodically.

 96 
 on: November 11, 2018, 02:14:43 PM 
Started by Paul Squires - Last post by Paul Squires
Hi Paul, I get a spurious mouse pointer hourglass during editing, usually after a failed compile. It takes quite a while to return to an arrow mouse pointer.
That is a odd behaviour and one that I have never experienced. Prior to compiling, WinFBE sets the screen cursor and the cursor related to the active scintilla document to an hourglass. Once compiling finishes then the cursors are reverted to previous states. After that is when any processing of successful/failed compile is handled.

If you can recreate the steps then it would help me a lot to fix it. How is compile invoked - toolbar icon, top menu, F5 shortcut? Is a file open or is a project open? Moving your mouse elsewhere in the application (outside of the code editor window), change the cursor back?

 97 
 on: November 11, 2018, 01:59:47 PM 
Started by Paul Squires - Last post by SeaVipe
Hi Paul, I get a spurious mouse pointer hourglass during editing, usually after a failed compile. It takes quite a while to return to an arrow mouse pointer.

 98 
 on: November 11, 2018, 01:16:19 PM 
Started by Paul Squires - Last post by Paul Squires
I have also fixed an irritating bug whereby if you cancelled the New Project dialog that a phantom new project would remain in memory causing issues when closing the application.

 99 
 on: November 10, 2018, 08:08:50 PM 
Started by Paul Squires - Last post by Paul Squires
Hi Ray yes Clive had somewhat similar suggestions that I will work on tomorrow. The find dialog is the one that is built-in to the web browser control. It is nodal and only works on the current document.

 100 
 on: November 10, 2018, 07:38:14 PM 
Started by Paul Squires - Last post by raymw
nit picking again... when 'find' window open, no other help window actions work, it would be nice to be able to scroll through the text. If you back/forward, the tree view does not highlight current section. The find only operates on open section, which pre-supposes I know where whatever I'm looking for can be found. Find does not maintain the last search word entered when find window closed.

Pages: 1 ... 8 9 [10]