Thread: [Gambas-user] Scrollarea Graphics
Brought to you by:
gambas
|
From: Sean S. K. <se...@un...> - 2014-11-17 13:50:23
|
Hello, I have the folloing setup (See attached image,
UI1.png). The Canvas is a scrollarea. I want to add text
commands, such as "ADDTILE 10,10 40,60 hello" in the
textbox called Command. I expect as output (on clicking
the button "exec") a tile of width 40 and height 60 to
appear with top left being 10, 10 in the canvas. Here is
my code :
' Gambas class file
Public func As String
Public cmds As String[]
Public Sub addtile()
Dim dtls As String[]
Dim coordinatestring As String
Dim coords As String[]
Dim tile_x As Integer
Dim tile_y As Integer
Dim sizestring As String
Dim size As String[]
Dim height As Integer
Dim width As Integer
Dim lbl As String
dtls = Me.cmds
Status.Text = "Adding tile"
coordinatestring = dtls[1]
coords = Split(coordinatestring, ",")
tile_x = Eval(coords[0])
tile_y = Eval(coords[1])
sizestring = dtls[2]
size = Split(sizestring, ",")
height = size[0]
width = size[1]
lbl = dtls[3]
Paint.Rectangle(tile_x, tile_y, width, height)
Paint.Stroke()
End
Public Sub execute()
Dim commands As String[]
Status.Text = "Executing Command"
commands = Split(Command.Text, " ", "\\", True,
False)
Select commands[0]
Case "ADDTILE"
Me.func = "addtile"
Me.cmds = commands
Case "REMOVETILE"
End Select
Command.Text = ""
Status.Text = "Done"
End
Public Sub _new()
func = "_new"
Canvas.ResizeContents(400, 400)
Canvas.Refresh()
End
Public Sub Form_Open()
End
Public Sub Status_MouseDown()
End
Public Sub History_KeyPress()
End
Public Sub Button1_Click()
execute()
End
Public Sub Command_KeyPress()
End
Public Sub Canvas_Draw()
Dim a As Variant[]
a = Canvas.Children
Object.Call(Me, func)
Canvas.Refresh()
End
You see, if I drop the canvas.refresh() in subroutine
canvas_draw() , then only the first tille would be drawn,
and all subsequent ADDTILE .... calls will be ignored,
i.e. no new tile is drawn.
If I keep the refresh() then only the last tile is drawn,
and the previous tiles are erased.
However, I want to keep on adding tiles, and keep the
previously added tiles.
Also, how do I remove a particular tile added, say as the
second one, in the sequence, of say, five tiles, and
retain the other four?
Thank you.
|
|
From: Tobias B. <ta...@gm...> - 2014-11-17 13:58:56
|
On Mon, 17 Nov 2014, Sean Sayandeep Khan wrote: > Hello, I have the folloing setup (See attached image, > UI1.png). The Canvas is a scrollarea. I want to add text > commands, such as "ADDTILE 10,10 40,60 hello" in the > textbox called Command. I expect as output (on clicking > the button "exec") a tile of width 40 and height 60 to > appear with top left being 10, 10 in the canvas. Here is > my code : > > --8< Snip --8<-- > > You see, > I see nothing. Please send a full project archive. I don't want to guess how your Form looks like and rebuild it manually. To get a source code archive, go into the IDE, menu Project -> Make -> Source archive. Please attach that thing. Once the source is here, we can tackle your questions. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Sean S. K. <se...@un...> - 2014-11-17 14:06:35
Attachments:
archive-0.0.1.tar.gz
|
Here the source archive : attached |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 14:17:46
|
What is your goal ? 2014-11-17 15:06 GMT+01:00 Sean Sayandeep Khan <se...@un...>: > Here the source archive : attached > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Fabien Bodard |
|
From: Sean S. K. <se...@un...> - 2014-11-17 14:22:13
|
@Fabian, this is from the first message : > ... I want to add text > commands, such as "ADDTILE 10,10 40,60 hello" in the > textbox called Command. I expect as output (on clicking > the button "exec") a tile of width 40 and height 60 to > appear with top left being 10, 10 in the canvas. Here is > my code : |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 17:09:04
Attachments:
archive-0.0.1~Pahu-0.0.1.patch
|
On Mon, 17 Nov 2014, Sean Sayandeep Khan wrote:
> Hello, I have the folloing setup (See attached image,
> UI1.png). The Canvas is a scrollarea. I want to add text
> commands, such as "ADDTILE 10,10 40,60 hello" in the
> textbox called Command. I expect as output (on clicking
> the button "exec") a tile of width 40 and height 60 to
> appear with top left being 10, 10 in the canvas. Here is
> my code :
>
> --8<-- Snip --8<--
>
> Public Sub _new()
>
> func = "_new"
> Canvas.ResizeContents(400, 400)
> Canvas.Refresh()
> End
>
> --8<-- Snip --8<--
>
> Public Sub Canvas_Draw()
>
> Dim a As Variant[]
> a = Canvas.Children
> Object.Call(Me, func)
>
> Canvas.Refresh()
> End
>
>
Did you notice that your program has a very high input latency? Above is the
reason why: _new() calls Canvas.Refresh() which triggers Canvas_Draw()
(during the next event loop?) which again calls _new(), and so on.
On a second glance, there is yet another loop: Canvas.Refresh() from inside
Canvas_Draw() triggers a (useless) new Canvas_Draw() event immediately after
this one finished.
So these two loops (only one after you executed the first command) spin in
the background drawing the same thing every free moment of your process'
life.
Note that the Draw event for ScrollAreas is triggered once when the program
starts, so Canvas.Refresh() in _new() is superfluous. The proper code would
be:
Public Sub _new()
Canvas.ResizeContents(400, 400)
End
Public Sub Canvas_Draw()
If Not func Then Return
Object.Call(Me, func)
End
Also note that (at least in more recent Gambas versions) Canvas.Children is
a virtual object so assigning it to a Variant[] variable a will produce an
error.
>
> You see, if I drop the canvas.refresh() in subroutine
> canvas_draw() , then only the first tille would be drawn,
> and all subsequent ADDTILE .... calls will be ignored,
> i.e. no new tile is drawn.
> If I keep the refresh() then only the last tile is drawn,
> and the previous tiles are erased.
>
> However, I want to keep on adding tiles, and keep the
> previously added tiles.
>
OK, I guess you don't understand the Draw event concept.
The Draw event of the Canvas object is raised whenever the interpreter deems
it necessary that the contents of Canvas be redrawn. Before each such redraw,
the Canvas is entirely cleared. You can force a Draw event by calling
Canvas.Refresh().
This explains both problems you stated above: if you drop Canvas.Refresh()
in Canvas_Draw(), then there are no new Draw events. How could the Canvas,
or the interpreter for that matter, know that someone entered a new command
and that this command has anything to do with drawing?
Solution: call Canvas.Refresh() when you received the command and want it to
be drawn, like in:
Public Sub execute()
Dim commands As String[]
' Your stuff as it was...
Canvas.Refresh()
End
This gets us immediately to the second problem you mentioned above. You only
see the outcome of your last command because the ScrollArea contents are
fleeting in the sense that whenever a Draw event is raised (like when you
force one with Canvas.Refresh() above), the entire ScrollArea is cleared for
you to redraw the image from scratch.
This behaviour is sometimes useful and always more efficient, memory-wise,
because we need to store only what is visible in the ScrollArea at a time,
not the whole (potentially arbitrarily large) virtual content through which
you can scroll.
Your application, however, needs a more persistent storage for your drawings,
right? I've heard artists used to paint "pictures". Maybe we can also try
that? :-) The basic idea is that your command interpreter does not paint
onto the (fleeting) Canvas directly but on an Image object. There, you can
draw sequentially, on top of what you drew before. Then you call Refresh()
and in Canvas_Draw() you simply put that Image onto the Canvas.
> Also, how do I remove a particular tile added, say as the
> second one, in the sequence, of say, five tiles, and
> retain the other four?
>
What sequence do you mean? :-) To talk about a sequence of commands, you
need to save a sequence of commands in your program, let's say in an array.
You can then loop through that array of commands to create a painting.
To remove some command from the sequence, remove the corresponding element
of the array and recreate the painting from the remaining elements.
If that's too inefficient for your needs (I'd guess the border is around a
few thousand commands here?), you can still paint over that tile with the
background colour. In any case, you need to somehow save the specification
of your tiles if you want to be able to remove them.
I will attach you a patch for your project which implements all the things
I discussed here, so you can play around with it. If your Gambas is recent
enough (I guess it is 3.5.4?), you can apply this patch via the IDE, menu
Project -> Patch -> Apply. [ And sorry, I couldn't help but tidy your code
up a bit on the way -- using my personal definition of "tidying up". ]
There is a demo button, labelled "TEST" for a quick tour of what the code
can do now.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
|
|
From: Fabien B. <gam...@gm...> - 2014-11-17 17:50:32
|
ouch ... i've a problem with your patch... it allow me to just ugrade the .project file... 2014-11-17 18:05 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Sean Sayandeep Khan wrote: >> Hello, I have the folloing setup (See attached image, >> UI1.png). The Canvas is a scrollarea. I want to add text >> commands, such as "ADDTILE 10,10 40,60 hello" in the >> textbox called Command. I expect as output (on clicking >> the button "exec") a tile of width 40 and height 60 to >> appear with top left being 10, 10 in the canvas. Here is >> my code : >> >> --8<-- Snip --8<-- >> >> Public Sub _new() >> >> func = "_new" >> Canvas.ResizeContents(400, 400) >> Canvas.Refresh() >> End >> >> --8<-- Snip --8<-- >> >> Public Sub Canvas_Draw() >> >> Dim a As Variant[] >> a = Canvas.Children >> Object.Call(Me, func) >> >> Canvas.Refresh() >> End >> >> > > Did you notice that your program has a very high input latency? Above is the > reason why: _new() calls Canvas.Refresh() which triggers Canvas_Draw() > (during the next event loop?) which again calls _new(), and so on. > > On a second glance, there is yet another loop: Canvas.Refresh() from inside > Canvas_Draw() triggers a (useless) new Canvas_Draw() event immediately after > this one finished. > > So these two loops (only one after you executed the first command) spin in > the background drawing the same thing every free moment of your process' > life. > > Note that the Draw event for ScrollAreas is triggered once when the program > starts, so Canvas.Refresh() in _new() is superfluous. The proper code would > be: > > Public Sub _new() > Canvas.ResizeContents(400, 400) > End > > Public Sub Canvas_Draw() > If Not func Then Return > Object.Call(Me, func) > End > > Also note that (at least in more recent Gambas versions) Canvas.Children is > a virtual object so assigning it to a Variant[] variable a will produce an > error. > >> >> You see, if I drop the canvas.refresh() in subroutine >> canvas_draw() , then only the first tille would be drawn, >> and all subsequent ADDTILE .... calls will be ignored, >> i.e. no new tile is drawn. >> If I keep the refresh() then only the last tile is drawn, >> and the previous tiles are erased. >> >> However, I want to keep on adding tiles, and keep the >> previously added tiles. >> > > OK, I guess you don't understand the Draw event concept. > > The Draw event of the Canvas object is raised whenever the interpreter deems > it necessary that the contents of Canvas be redrawn. Before each such redraw, > the Canvas is entirely cleared. You can force a Draw event by calling > Canvas.Refresh(). > > This explains both problems you stated above: if you drop Canvas.Refresh() > in Canvas_Draw(), then there are no new Draw events. How could the Canvas, > or the interpreter for that matter, know that someone entered a new command > and that this command has anything to do with drawing? > > Solution: call Canvas.Refresh() when you received the command and want it to > be drawn, like in: > > Public Sub execute() > Dim commands As String[] > > ' Your stuff as it was... > Canvas.Refresh() > End > > This gets us immediately to the second problem you mentioned above. You only > see the outcome of your last command because the ScrollArea contents are > fleeting in the sense that whenever a Draw event is raised (like when you > force one with Canvas.Refresh() above), the entire ScrollArea is cleared for > you to redraw the image from scratch. > > This behaviour is sometimes useful and always more efficient, memory-wise, > because we need to store only what is visible in the ScrollArea at a time, > not the whole (potentially arbitrarily large) virtual content through which > you can scroll. > > Your application, however, needs a more persistent storage for your drawings, > right? I've heard artists used to paint "pictures". Maybe we can also try > that? :-) The basic idea is that your command interpreter does not paint > onto the (fleeting) Canvas directly but on an Image object. There, you can > draw sequentially, on top of what you drew before. Then you call Refresh() > and in Canvas_Draw() you simply put that Image onto the Canvas. > >> Also, how do I remove a particular tile added, say as the >> second one, in the sequence, of say, five tiles, and >> retain the other four? >> > > What sequence do you mean? :-) To talk about a sequence of commands, you > need to save a sequence of commands in your program, let's say in an array. > You can then loop through that array of commands to create a painting. > > To remove some command from the sequence, remove the corresponding element > of the array and recreate the painting from the remaining elements. > > If that's too inefficient for your needs (I'd guess the border is around a > few thousand commands here?), you can still paint over that tile with the > background colour. In any case, you need to somehow save the specification > of your tiles if you want to be able to remove them. > > I will attach you a patch for your project which implements all the things > I discussed here, so you can play around with it. If your Gambas is recent > enough (I guess it is 3.5.4?), you can apply this patch via the IDE, menu > Project -> Patch -> Apply. [ And sorry, I couldn't help but tidy your code > up a bit on the way -- using my personal definition of "tidying up". ] > > There is a demo button, labelled "TEST" for a quick tour of what the code > can do now. > > Regards, > Tobi > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 17:57:20
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > ouch ... i've a problem with your patch... it allow me to just ugrade > the .project file... > Strange. For me it works as follows: 1. Unpack the archive.tar.gz from Sean, 2. Open that project, 3. Project -> Patch -> Apply, 4. Applies cleanly. Did you do that? The patch may not apply if you changed the code base yourself too heavily. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 22:03:46
|
2014-11-17 22:47 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Fabien Bodard wrote: >> This is the hexdump >> > > Yep, it has those weird 0xd 0xa sequences, a.k.a. Windows-style newlines, > which my original file didn't have... Can't be too difficult to make the > patch parser resistant to that, as Gambas already supports different line > delimiters in the Stream class. > > Also Sean, sorry for hijacking this thread. yes it's that : 125: aScan = Scan(.LineInfo, "@@ -* +* @@") the line finish by \r so in this case aScan is null.. you can simply do : aScan = Scan(Rtrim(.LineInfo), "@@ -* +* @@") It a good moment for hijacking ! > > Regards, > Tobi > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-29 19:37:10
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > 2014-11-17 22:47 GMT+01:00 Tobias Boege <ta...@gm...>: > > On Mon, 17 Nov 2014, Fabien Bodard wrote: > >> This is the hexdump > >> > > > > Yep, it has those weird 0xd 0xa sequences, a.k.a. Windows-style newlines, > > which my original file didn't have... Can't be too difficult to make the > > patch parser resistant to that, as Gambas already supports different line > > delimiters in the Stream class. > > > > Also Sean, sorry for hijacking this thread. > yes it's that : > 125: aScan = Scan(.LineInfo, "@@ -* +* @@") > > the line finish by \r > > so in this case aScan is null.. > > you can simply do : aScan = Scan(Rtrim(.LineInfo), "@@ -* +* @@") > The more I think about it, the less I want to change it. What if someone creates a patch which correctly contains a \r\n sequence? I just can't remove the \r at line ends without risking actual data loss. Your problem was caused by your mail client or something which changed the \n to \r\n. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 18:05:51
|
nothing to do ... at same on a clean unpacked project. 2014-11-17 18:54 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Fabien Bodard wrote: >> ouch ... i've a problem with your patch... it allow me to just ugrade >> the .project file... >> > > Strange. For me it works as follows: > > 1. Unpack the archive.tar.gz from Sean, > 2. Open that project, > 3. Project -> Patch -> Apply, > 4. Applies cleanly. > > Did you do that? The patch may not apply if you changed the code base > yourself too heavily. > > Regards, > Tobi > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 18:53:05
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > nothing to do ... at same on a clean unpacked project. > I have no explanation. I think we're both using pretty recent Gambas versions and nothing was done to the patch dialogs recently... You can still try to apply the patch manually, assuming the source archive and the patch are both in /tmp: $ cd /tmp/ $ tar -zxvf archive-0.0.1.tar.gz Pahu/ Pahu/.settings Pahu/.src/ Pahu/.src/FMain.form Pahu/.src/FMain.class Pahu/.project Pahu/.directory Pahu/.action/ Pahu/.icon.png Pahu/.lang/ Pahu/.startup Pahu/.gambas/ Pahu/.hidden/ $ cd Pahu/ $ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch patching file .project patching file .src/FMain.class patching file .src/FMain.form gives me the patched project in /tmp/Pahu. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 21:14:19
|
[fabien@mobifab GAMBAS]$ tar -zxvf archive-0.0.1.tar.gz Pahu/ Pahu/.settings Pahu/.src/ Pahu/.src/FMain.form Pahu/.src/FMain.class Pahu/.project Pahu/.directory Pahu/.action/ Pahu/.icon.png Pahu/.lang/ Pahu/.startup Pahu/.gambas/ Pahu/.hidden/ [fabien@mobifab GAMBAS]$ cd Pahu/ [fabien@mobifab Pahu]$ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch (Stripping trailing CRs from patch; use --binary to disable.) patching file .project (Stripping trailing CRs from patch; use --binary to disable.) patching file .src/FMain.class (Stripping trailing CRs from patch; use --binary to disable.) patching file .src/FMain.form [fabien@mobifab Pahu]$ then it work in the direct way ... file is correctly patched... 2014-11-17 19:49 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Fabien Bodard wrote: >> nothing to do ... at same on a clean unpacked project. >> > > I have no explanation. I think we're both using pretty recent Gambas > versions and nothing was done to the patch dialogs recently... > > You can still try to apply the patch manually, assuming the source archive > and the patch are both in /tmp: > > $ cd /tmp/ > $ tar -zxvf archive-0.0.1.tar.gz > Pahu/ > Pahu/.settings > Pahu/.src/ > Pahu/.src/FMain.form > Pahu/.src/FMain.class > Pahu/.project > Pahu/.directory > Pahu/.action/ > Pahu/.icon.png > Pahu/.lang/ > Pahu/.startup > Pahu/.gambas/ > Pahu/.hidden/ > $ cd Pahu/ > $ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch > patching file .project > patching file .src/FMain.class > patching file .src/FMain.form > > gives me the patched project in /tmp/Pahu. > > Regards, > Tobi > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 21:18:20
|
Maybe the difference in my output of patch make trouble in the output parsing in the IDE 2014-11-17 22:14 GMT+01:00 Fabien Bodard <gam...@gm...>: > [fabien@mobifab GAMBAS]$ tar -zxvf archive-0.0.1.tar.gz > Pahu/ > Pahu/.settings > Pahu/.src/ > Pahu/.src/FMain.form > Pahu/.src/FMain.class > Pahu/.project > Pahu/.directory > Pahu/.action/ > Pahu/.icon.png > Pahu/.lang/ > Pahu/.startup > Pahu/.gambas/ > Pahu/.hidden/ > [fabien@mobifab GAMBAS]$ cd Pahu/ > [fabien@mobifab Pahu]$ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .project > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .src/FMain.class > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .src/FMain.form > [fabien@mobifab Pahu]$ > > then it work in the direct way ... file is correctly patched... > > > 2014-11-17 19:49 GMT+01:00 Tobias Boege <ta...@gm...>: >> On Mon, 17 Nov 2014, Fabien Bodard wrote: >>> nothing to do ... at same on a clean unpacked project. >>> >> >> I have no explanation. I think we're both using pretty recent Gambas >> versions and nothing was done to the patch dialogs recently... >> >> You can still try to apply the patch manually, assuming the source archive >> and the patch are both in /tmp: >> >> $ cd /tmp/ >> $ tar -zxvf archive-0.0.1.tar.gz >> Pahu/ >> Pahu/.settings >> Pahu/.src/ >> Pahu/.src/FMain.form >> Pahu/.src/FMain.class >> Pahu/.project >> Pahu/.directory >> Pahu/.action/ >> Pahu/.icon.png >> Pahu/.lang/ >> Pahu/.startup >> Pahu/.gambas/ >> Pahu/.hidden/ >> $ cd Pahu/ >> $ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch >> patching file .project >> patching file .src/FMain.class >> patching file .src/FMain.form >> >> gives me the patched project in /tmp/Pahu. >> >> Regards, >> Tobi >> >> -- >> "There's an old saying: Don't change anything... ever!" -- Mr. Monk >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk >> _______________________________________________ >> Gambas-user mailing list >> Gam...@li... >> https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > -- > Fabien Bodard -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 21:20:22
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > [fabien@mobifab GAMBAS]$ tar -zxvf archive-0.0.1.tar.gz > Pahu/ > Pahu/.settings > Pahu/.src/ > Pahu/.src/FMain.form > Pahu/.src/FMain.class > Pahu/.project > Pahu/.directory > Pahu/.action/ > Pahu/.icon.png > Pahu/.lang/ > Pahu/.startup > Pahu/.gambas/ > Pahu/.hidden/ > [fabien@mobifab GAMBAS]$ cd Pahu/ > [fabien@mobifab Pahu]$ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .project > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .src/FMain.class > (Stripping trailing CRs from patch; use --binary to disable.) > patching file .src/FMain.form > [fabien@mobifab Pahu]$ > > then it work in the direct way ... file is correctly patched... > OK, thanks for output above. Seemingly your "patch" program is a bit more picky than mine. Maybe I can do something about that kind of error/warning in the patch dialogs... -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 21:25:56
Attachments:
capture1.png
|
But what is curious that is the FPath dialog output .. is present to me only the .project file ... look at the screenshot. Normally no program will affect the parsing of the file as the Patch class doing it in pur gambas way. 2014-11-17 22:17 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Fabien Bodard wrote: >> [fabien@mobifab GAMBAS]$ tar -zxvf archive-0.0.1.tar.gz >> Pahu/ >> Pahu/.settings >> Pahu/.src/ >> Pahu/.src/FMain.form >> Pahu/.src/FMain.class >> Pahu/.project >> Pahu/.directory >> Pahu/.action/ >> Pahu/.icon.png >> Pahu/.lang/ >> Pahu/.startup >> Pahu/.gambas/ >> Pahu/.hidden/ >> [fabien@mobifab GAMBAS]$ cd Pahu/ >> [fabien@mobifab Pahu]$ patch -p1 <../archive-0.0.1~Pahu-0.0.1.patch >> (Stripping trailing CRs from patch; use --binary to disable.) >> patching file .project >> (Stripping trailing CRs from patch; use --binary to disable.) >> patching file .src/FMain.class >> (Stripping trailing CRs from patch; use --binary to disable.) >> patching file .src/FMain.form >> [fabien@mobifab Pahu]$ >> >> then it work in the direct way ... file is correctly patched... >> > > OK, thanks for output above. Seemingly your "patch" program is a bit more > picky than mine. Maybe I can do something about that kind of error/warning > in the patch dialogs... > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 21:34:23
Attachments:
patch-dialog.png
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > But what is curious that is the FPath dialog output .. is present to > me only the .project file ... look at the screenshot. Normally no > program will affect the parsing of the file as the Patch class doing > it in pur gambas way. > Indeed. Actually I don't remember testing the parser with weird data. Could you send me the "hexdump -C" of the patch file you're using? Maybe it got screwed up somewhere between my mail client and your hard disk? It works here, as the attached screenshot shows. In any case, something I need to investigate when I have time. -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |
|
From: Fabien B. <gam...@gm...> - 2014-11-17 21:43:35
Attachments:
hexdump.out
|
This is the hexdump 2014-11-17 22:31 GMT+01:00 Tobias Boege <ta...@gm...>: > On Mon, 17 Nov 2014, Fabien Bodard wrote: >> But what is curious that is the FPath dialog output .. is present to >> me only the .project file ... look at the screenshot. Normally no >> program will affect the parsing of the file as the Patch class doing >> it in pur gambas way. >> > > Indeed. Actually I don't remember testing the parser with weird data. Could > you send me the "hexdump -C" of the patch file you're using? Maybe it got > screwed up somewhere between my mail client and your hard disk? It works > here, as the attached screenshot shows. > > In any case, something I need to investigate when I have time. > > -- > "There's an old saying: Don't change anything... ever!" -- Mr. Monk > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Fabien Bodard |
|
From: Tobias B. <ta...@gm...> - 2014-11-17 21:50:49
|
On Mon, 17 Nov 2014, Fabien Bodard wrote: > This is the hexdump > Yep, it has those weird 0xd 0xa sequences, a.k.a. Windows-style newlines, which my original file didn't have... Can't be too difficult to make the patch parser resistant to that, as Gambas already supports different line delimiters in the Stream class. Also Sean, sorry for hijacking this thread. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk |