PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 10
 11 
 on: October 14, 2019, 12:51:49 PM 
Started by Shawn Anderson - Last post by Shawn Anderson
perfect, thanks

 12 
 on: October 13, 2019, 02:34:23 PM 
Started by Paul Squires - Last post by Joerg Buckel
Hello Paul

When I include an empty resource file, I don't get this behavior.
Then it's not WinFBE.

But what is wrong with the resource file?

Code: [Select]
VERSION_INFO VERSIONINFO
IDR_ICON ICON ".\Key.ico"

#define IDR_VERSION1 1

IDR_VERSION1 VERSIONINFO
FILEVERSION 0,0,0,1
PRODUCTVERSION 0,0,0,1
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040704B0"
    BEGIN
      VALUE "FileVersion", "0.0.0.1\0"
      VALUE "ProductVersion", "0.0.0.1\0"
      VALUE "CompanyName", "CompanyName\0"
      VALUE "FileDescription", "FileDescription\0"
      VALUE "InternalName", "InternalName\0"
      VALUE "LegalCopyright", "LegalCopyright 2019\0"
      VALUE "LegalTrademarks", "LegalTrademarks\0"
      VALUE "OriginalFilename", "OriginalFilename.exe\0"
      VALUE "ProductName", "ProductName.exe\0"
      VALUE "Information", "Information 2019\0"
      VALUE "Nutzen", "Nutzen.\0"
      VALUE "Hinweis", "Hinweis\0"
    END
  END
  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x0407, 0x04B0
  END
END

 13 
 on: October 13, 2019, 01:38:17 PM 
Started by Paul Squires - Last post by Joerg Buckel
Hello Paul

I've often had "test projects" quit after compiling and starting as soon as a status bar was inserted.
I haven't searched for the error myself yet.
As soon as the status bar was deactivated, the program worked again.

I once attached a very small test project without much code in the attachment. In the two Exe-files 

In the example there is only one form with frame, buttons, a status bar with four fields (0-3) with assigned labels. But only the first label is displayed.
There is no difference whether the individual fields are named immediately or during initialization.

 14 
 on: October 12, 2019, 10:26:43 PM 
Started by Paul Squires - Last post by raymw
Thanks Paul, for offering to look. I'm not sure if it will duplicate on your pc, but if you want to try, it was based on your code from a week or two back, I wanted to plot more than one line from some other 'form', not all at one go, so I moved things around a bit. Much of the cgi graphic help is based on .net, it seems, so it was pretty much guess work as to where the boundaries between the form, graphic and pen,brush were. Anyway, as usual, it gets in a bit of a mess, but this version was as near as I got, but I'm uncertain as to how much is from what is seen here, if unseen code is sort of hanging around from previous iterations.

the graphics drawing form
Code: [Select]
''
''  Remove the following Application.Run code if it used elsewhere in your application.

'dim shared pGraphCtx AS CGraphCtx ptr

const IDC_GRCTX = 2000
   

dim shared ngraphics as cgpgraphics =hdc
' ========================================================================================
' The following example draws a line.
' ========================================================================================
SUB Example_DrawLine (x1 as single,y1 as single,x2 as single,y2 as single)

   ' // Create a graphics object from the window device context
 
   ' // Draw the line
   DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(255, 0, 0, 0), 3)
   ngraphics.DrawLine(@blackPen, x1,y1,x2,y2)
 
   ?x1,y1

END SUB
' ========================================================================================
function     makegraphics(byref sender as wfxform,byref e as eventargs) as lresult
 pGraphCtx = new CGraphCtx( sender.pWindow, _
                              IDC_GRCTX, "drawing", _
                              px, py, _
                              sender.ClientSize.Width-100, _
                              sender.ClientSize.Height-100)

      ahdc  = pGraphCtx->GetMemDc
      ngraphics =ahdc
       
DIM rxRatio AS SINGLE = ngraphics.GetDpiX / 96
   DIM ryRatio AS SINGLE = ngraphics.GetDpiY / 96
      ngraphics.ScaleTransform(rxRatio, ryRatio)         

function=0
end function
''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT

px=50
py=50
makegraphics(sender,e)
               
 ' pGraphCtx->Clear BGR(255, 255, 255)     
   function = 0
End Function


''
''
Function frmMain_FormClosed( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   if pGraphCtx then Delete pGraphCtx
   Function = 0
End Function

''
''
Function frmmain_Resize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
 
   
 

    ' DIM hdc AS HDC = pGraphCtx->GetMemDc
                             
   ' // Draw the graphics
   Example_DrawLine( 100,100,600,200)
   example_drawline(60,60,400,200)
 '  pgraphcts.setvirtualbuffersize(80,80)
   Function = 0
End Function

''
''

''
''
Function frmmain_Move( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   makegraphics(sender,e)
   example_drawline(90,40,800,70)
   Function = 0
End Function

''
''



the button form  (start)

Code: [Select]
''
''  Remove the following Application.Run code if it used elsewhere in your application.
Application.Run(start)
 #include "paulsagain.bas"
''
''

SUB DrawLine (x1 as single,y1 as single,x2 as single,y2 as single)

   ' // Create a graphics object from the window device context
'   DIM graphics AS CGpGraphics = ahdc
   
'   ' // Get the DPI scaling ratios
'   DIM rxRatio AS SINGLE = graphics.GetDpiX / 96
'   DIM ryRatio AS SINGLE = graphics.GetDpiY / 96
   
   ' // Set the scale transform
  ' graphics.ScaleTransform(rxRatio, ryRatio)

   ' // Draw the line
   DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(255, 0, 0, 0), 3)
 '  ngraphics.DrawLine(@blackPen, x1,y1,x2,y2)
 
   ?x1,y1

END SUB

Function start_Click( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   Function = 0
End Function

''
''
Function start_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   frmmain.show
   Function = 0
End Function

''
''
Function start_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
         
   makegraphics(oform,esend)   
   example_drawline(val(start.text1.text),100,300,400)
   
 ' drawline(val(start.text1.text),100,400,300)
   Function = 0
End Function


note this is altered since I mentioned first, but should explain - it only compiles/runs if makegraphics (oform,esend) is in the start_button function. Leave it out, line is not drawn, change oform/esend to other names, it does not compile. At one stage there was a dim shared graphics with oform and esend. but that was commented out, and since deleted, but it seems something is still hanging on. I would expect it to not compile with the makegraphics line, or if it did compile it would do so with anything instead of oform/esend.

Basically, what I'm trying to do, is draw a number of lines by clicking the button and changing the text value (that is not he ultimate goal, but if I can't do that, then I'll have to do something else). It only displays the last line. The size change and move for the frmmain lines also are not displayed at the same time, but you can see both sets of lines when the form is moved. Something obviously I do not understand, but it does not help when commented out code still appears to function. I've checked as best as I can in the include files code, but they have no oform or esend within.

edit to add.

The frmmain form, the first code window above, runs fine, no compile errors in the original project. It should run outside of the project. Copying the code, as above, and creating a frmmain form, with the various events needed, throws a number of compiler errors (referring to items that were once shared in the original project)
such as
Variable not declared, hdc
Variable not declared, pGraphCtx
Variable not declared, ahdc

 15 
 on: October 12, 2019, 08:57:39 PM 
Started by Paul Squires - Last post by Paul Squires
Hi Ray,

You may want to start posting your sample project files to your posts so that we can see the actual code. I have a hard time understanding the logic flow of your program just from the description you've posted.

 16 
 on: October 12, 2019, 04:33:43 PM 
Started by Paul Squires - Last post by raymw
I created a form for trying out the gdiplus graphics. I created another form with a button and text box to send xy coordinates to the graphics. I have spent literally days, trying to understand this graphics stuff. (That is not the point of this query, exactly.) I tried sharing whatever variable/objects that I could, so that the button form could have access to the graphics form. I've been adding and commenting out code, and more or less got it working almost in the way I want. I commented out all the shared items, and it seemed to still keep running.

The button form calls a function to set up the graphics - makegraphics(oform,esend) where oform and esend were the original shared values for the graphic window sender and event. The dim shared oform and dim shared esend are commented out. If I remove the makegraphics(oform,esend) line from the button-click code, the line is not drawn, if I change it to, say, makegraphics(anyform, anysend) in the function call, the compiler throws an error wrt undefined variable. If I leave it as  makegraphics(oform,esend), it draws the line whether or not the dim shareds are commented out. That infers to me, that even though they are commented out, the variables are still recognised on compiling. There are no other references in the program to oform or esend.

 17 
 on: October 12, 2019, 01:47:41 PM 
Started by Paul Squires - Last post by raymw
windows 10 and winfbe editor in task bar, having been using it. Curser over task bar icon, it shows the editor screen only, just above the icon, but the full screen shows the editor and the gui toolbox. Clicking the icon, the editor opens, gui toolbox disappears. Hovering over task bar icon, when editor is full screen, it just shows the editor, as it should. The program was not using or showing the gui toolbox when put on task bar, but the toolbox window shows the last toolbox window that was used. Seems quite consistent, - open winfbe, load/write a program with a form, open the designer, close designer, shrink program to task bar. I've not noticed it before, and wonder if it is connected with the erroneous border styles I am getting with 1.9.4

 18 
 on: October 12, 2019, 01:19:30 PM 
Started by raymw - Last post by raymw
Not a problem, but I needed to know, after some poking around, I found that when a form is loaded, it does a resize and a move. If when it loads, it has a form.visible=false, then it does a resize only.

 19 
 on: October 11, 2019, 06:42:59 PM 
Started by Shawn Anderson - Last post by SeaVipe
Hi Shawn,
FF_CloseForm( HWND_MyForm, 0 ) is the built-in FF routine that when called with the projects startup form as its first parameter will shut down the app. I use MyForm_WM_DESTROY function to do some tidying up before the app is shut down. The second parameter is the FF_CloseForm return value.
A less elegant way is to call END which doesn't leave you much except END's return value after the app immediately shuts down.
DestroyWindow HWND_MyForm is not recommended.
I hope this helps.

 20 
 on: October 11, 2019, 04:31:47 PM 
Started by Shawn Anderson - Last post by Shawn Anderson
How can I programmatically quit a FF program?

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