PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: find and replace  (Read 668 times)

SeaVipe

  • Junior Member
  • **
  • Posts: 193
  • Windows 10
Re: find and replace
« Reply #15 on: October 01, 2019, 01:18:25 PM »

Hi Ray,
Here are the results after a bit of fiddling...


I changed the thickness of the line from 3 to 1.


Note that the caption for frmMain is "XfrmMain" but only the "X" is displayed.
frmMain Events: Load, FormClosed
Also, 6 compiler Warnings that with a little research I should be able to get rid of.
Here are the compiler switches I have set: -g -exx -w Pedantic -w Escape -w Next -w 0 -w All (probably not the best way to set compiler switches)
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #16 on: October 01, 2019, 03:07:45 PM »

Thanks Clive,
I'll poke at it some more. Presumably you didn't test on 1.93? . Not sure whether that may help, because I guess Paul tests on whatever version of winfbe he is developing at the time, and he's just released another one..
Logged

SeaVipe

  • Junior Member
  • **
  • Posts: 193
  • Windows 10
Re: find and replace
« Reply #17 on: October 01, 2019, 03:20:21 PM »

Hi Ray, I used 1.9.3 (the most recent - C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc64.exe), 64Bit, Win64 Console (debug).
Successfully compilled using WinFBE 1.9.2 although it thew 2 more compiler warnings.
« Last Edit: October 01, 2019, 03:36:58 PM by SeaVipe »
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #18 on: October 03, 2019, 07:26:48 PM »

What you got to do, a duh moment, pointed out to me by Paul - is you have to set the form properties to load and close. So flipping obvious when you know.

Thanks Paul, again  :D
Logged

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #19 on: October 03, 2019, 09:04:54 PM »

Right, almost there, but I'm finding that often the border styles for the forms or list boxes appear to randomly change to a non-valid type for that particular control. I reset it in the designer properties, it then compiles, until the next time, it is happening rather frequently.
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8865
  • Windows 10
    • PlanetSquires Software
Re: find and replace
« Reply #20 on: October 04, 2019, 06:33:52 AM »

Right, almost there, but I'm finding that often the border styles for the forms or list boxes appear to randomly change to a non-valid type for that particular control. I reset it in the designer properties, it then compiles, until the next time, it is happening rather frequently.
Interesting that you'd say that because eary in the visual designer development I would notice this as well. I implemented a fix and it seemed to had worked, but if you're seeing it then I better investigate more. It is related to a got/lost focus issue when the user moves from control to control.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #21 on: October 04, 2019, 10:11:25 AM »

Hi Paul,

I just thought I'd show some of the effects I get with my programmatically generated spiral g-code. This is not what it is about, but the results are sort of pretty, if you like spikey things. A week or two ago, I was running the 2D gcode produced by my c# program, (written about 4 years ago) through a fb file, to pull it apart and add in the z coordinates. Now, I've translated the c# into fb, and added in my 3d stuff. The pictures are not 3d, merely varied the black pen colour values as each line drawn. I'm well pleased. Flying through rocks comes later.

(btw, found another very minor issue, easily solved - labels in designer. In the designer, all the characters show, but if nearly filling the label box, it is truncated in the label when form is loaded e.g. 'number points', originally, but truncated to 'number' .It seems the label size varies between design and run - simple enough to drag it a bit bigger in the designer.)

Thanks for your patience.



Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8865
  • Windows 10
    • PlanetSquires Software
Re: find and replace
« Reply #22 on: October 04, 2019, 03:02:29 PM »

The truncation could be due to having another control overlapping the end of the label? The zorder could be different between designer view and runtime depending on the order in which the controls are created.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #23 on: October 04, 2019, 03:28:48 PM »

I don't think it is to do with overlapping, Text is left aligned, and I drag to the right. If it overlapped, the text to right would be obscured, I think. Plenty of space around the labels in designer.
Another puzzling fundamental question for me - Is it possible to send data between forms without writing via textboxes/list/boxes, other elements?  Something like form1.double1 = form2.double2. I can't get variables in a form recognised outside of the form, there is bound to be a simple answer that I can't think of.
Logged

SeaVipe

  • Junior Member
  • **
  • Posts: 193
  • Windows 10
Re: find and replace
« Reply #24 on: October 04, 2019, 04:20:36 PM »

Quote
Something like form1.double1 = form2.double2.


Like a shared variable?
« Last Edit: October 04, 2019, 05:53:33 PM by SeaVipe »
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #25 on: October 04, 2019, 05:48:36 PM »

Maybe, . at the moment, I'm using the 'graphics' form (frmmain)to get values from my  spiralform fields. e.g. with code in frmmain like x1 = val(spiralform.xs.SelectedItem.text ) *scale   +xoff
But, I would prefer values to be 'pushed', instead of pulled to the graphics form. Obviously, I can create list boxes on the graphics form, but I'd rather have the graphic's form be more generic, e.g, be able to set something like this in my spiralform code  - frmmain.x1 =  val(spiralform.xs.SelectedItem.text ) *scale  +xoff (and since I'm using in the spiralform xs1 = val(spiralform.xs.selecteditem) then it would make sense after that conversion, to send the value to frmmain as frmmain.xs= spiralform.xs1*scale+xoff. maybe needs to be a set/get or similar.

The intention is to have frmmain (which I will eventually rename - maybe 'plotme') as a standard sort of graphic routine to plot lines. I do not want to alter its code whenever  it needs  values from different forms.

Any help appreciated.
Logged

SeaVipe

  • Junior Member
  • **
  • Posts: 193
  • Windows 10
Re: find and replace
« Reply #26 on: October 04, 2019, 06:05:02 PM »

I sometimes use the Form's Tag property. If I need the Tag string value to be numeric (like a double) then, like your sample code, I use Val().
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #27 on: October 04, 2019, 06:35:20 PM »

Thanks Clive. I've used textboxes (hidden) but to my mind that is an unnecessary overhead. Still, moving things around as strings will have to do until something more succinct comes to mind.
I thought I could have a shared text box,(dtr.text, say) that the the two forms could access. Looking at it from a master slave communications situation, that the master sends values, the slave sets dtr.text to "stop" the master stops sending, slave processes the data it has received, sets dtr.text to "go", master sends some more. It may work, but not so far. I'll sleep on it.
« Last Edit: October 04, 2019, 08:06:43 PM by raymw »
Logged

SeaVipe

  • Junior Member
  • **
  • Posts: 193
  • Windows 10
Re: find and replace
« Reply #28 on: October 04, 2019, 08:44:53 PM »


Sample of The control's TAG propertyIn frmSettings:
Code: [Select]

Function frmSettings_btnTest_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
   
    Dim as string s = "frmMain.Tag set in frmMain = " + frmMain.Tag + CRLF
    frmMain.Tag = "123"
    s += "frmMain.Tag set in frmSettings = " + frmMain.Tag + CRLF
    s += "frmSettings.Tag set in frmMain = " + str(val(frmSettings.Tag )) + CRLF
    Dim as double d = val(frmSettings.Tag )
    s += "Sqr of frmSettings.Tag = " + Str( sqr(d) )
   
    frmSettings.lblTagDisplay.text = s
   
    Function = 0
End Function

in frmMain:
Code: [Select]
Function frmMain_btnSettings_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
   
    frmSettings.Tag = "54321.1234"   
    frmMain.Tag = "987"
    frmSettings.ShowDialog( frmMain ) ' Modal
    ? "-"; frmMain.Tag
       
    Function = 0
End Function


Output in image:
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

raymw

  • Senior Member
  • ***
  • Posts: 318
Re: find and replace
« Reply #29 on: October 05, 2019, 01:29:54 PM »

The graphics part is just to give a clue as to what the final machined object will look like. I've created a couple of hidden listboxes in the graphics form, and push the values from my main form to there. It works OK, but I may work on it some more. I'm not sure if I want to print or save the drawing as a separate entity, as opposed to saving the G-code and making the thing. Thought you may be interested.  Machined out of resin for  prototyping. Works OK. A couple of quick phone snaps.
« Last Edit: October 05, 2019, 01:31:35 PM by raymw »
Logged
Pages: 1 [2] 3