VisualFBEditor icon indicating copy to clipboard operation
VisualFBEditor copied to clipboard

ChineseCalendar shows nothing but black window

Open retsyo opened this issue 1 year ago • 31 comments

lastet VisualFBEditor and myfbframework, but ChineseCalendar shows nothing but black window 中文:使用刚下载的VisualFBEditor和myfbframework,但是编译出来的ChineseCalendar窗口一片黑,其余啥都没有

buggy_clock

retsyo avatar Dec 09 '23 12:12 retsyo

I haven't had the time to download the latest VFBE and MFF yet. I'll try them out when I have some free time. 我还没有空下载最新的vfbe和mff,有空去试试看

chunmingwang avatar Dec 09 '23 13:12 chunmingwang

the buggy one is the ChineseCalendar in VisualFBEditor, not that one in your repositories

是 VisualFBEditor 里面的例子只有黑色,不是你代码库中的例子

retsyo avatar Dec 09 '23 13:12 retsyo

it‘s same to me, maybe this PR caused it 和我一样,也许是这个pr导致的 https://github.com/XusinboyBekchanov/VisualFBEditor/commit/d7821367f1e80fffd97179448a68c9dfbd5060f7

chunmingwang avatar Dec 09 '23 14:12 chunmingwang

Yes, after hustbeef's pull request this happened.

After this fix it now shows:

Update DrawClockCalendar.bas: https://github.com/XusinboyBekchanov/VisualFBEditor/commit/1faa6d3ebb1c9e2c8e74133cc195fca7280754fc

XusinboyBekchanov avatar Dec 09 '23 14:12 XusinboyBekchanov

Do you updated the MFF? It is fine working in my laptop.
Canvas.Pen.Color = mClr(0) 'Canvas.Line 0, 0, Canvas.Width, Canvas.Height, mClr(0) , "F" this function is like backcolor but it is very slow. So I remove this code and add code in frmClock.frm ' Panel1 With Panel1 .Name = "Panel1" ...... '.BackColor = -1 .DoubleBuffered = True **.BackColor = 16766975** .Transparent = True ........... End With _It is better remove this code and make everthing is fine.

hustbeef avatar Dec 10 '23 00:12 hustbeef

image

hustbeef avatar Dec 10 '23 00:12 hustbeef

There BackColor is set to -1, so it will appear black.

XusinboyBekchanov avatar Dec 10 '23 00:12 XusinboyBekchanov

Recently I upgrade the control Panel , Picture and canvas for better drawing. I think It's too simple to draw a more realistic hour, minute, and second hand now.

hustbeef avatar Dec 10 '23 00:12 hustbeef

Usually, the painting is first drawn on the memory DC, and then copied and overlaid in the form DC for display. Avoid flickering caused by drawing and display at the same time,this is call double buffer.

通常绘画都是先绘制在内存设备上,完成后再复制覆盖在窗口显示出来 避免一面绘制一面显示导致的画面闪烁,这就是双缓存.

chunmingwang avatar Dec 10 '23 09:12 chunmingwang

Yes. Better set .DoubleBuffered = True It isI forgot updated the frmClock.frm with .BackColor =ClPink. Switch the mode on menu Item "Clock" image image

hustbeef avatar Dec 11 '23 01:12 hustbeef

推荐可用的翻译工具 https://fanyi.baidu.com/ https://www.deepl.com/

retsyo avatar Dec 11 '23 02:12 retsyo

Analog clocks require better window effects, and it is better to use the UpdateLayeredWindow. You can refer to UEZ's GDI+Swiss Railway Clock

指针时钟需要更好的效果最好用UpdateLayeredWindow窗口 可以参考UEZ的GDI+ Swiss Railway Clock image

https://www.freebasic.net/forum/viewtopic.php?t=26454

chunmingwang avatar Dec 11 '23 03:12 chunmingwang

Because I am drawing with a low-quality PNG file. Now I have improved the code, fixed drawing on forms directly, and removed the function SetLayeredWindowAttributes, It could be working on OS Linux in the future.

image

image

hustbeef avatar Dec 11 '23 06:12 hustbeef

gdip_click

chunmingwang avatar Dec 13 '23 08:12 chunmingwang

A very good example, you can update ChineseCalendar.

XusinboyBekchanov avatar Dec 13 '23 09:12 XusinboyBekchanov

Yes, I will. I am still fine-tuning some issues.

chunmingwang avatar Dec 13 '23 09:12 chunmingwang

I spend 3 hours to upgrade the png files. So I post it. image

hustbeef avatar Dec 13 '23 09:12 hustbeef

I release a PR to add a gdipClock example https://github.com/XusinboyBekchanov/VisualFBEditor/pull/586

chunmingwang avatar Dec 19 '23 09:12 chunmingwang

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

I also suggest to modify the code in own fork. Only do pull requests if new code has been tested throughly on different OS, for example different Windows and Linux in a virtualization software.

Although there is not so many coders who can really contribute to this project, I think stability is always a good consideration.


现在的ChineseCalendar一运行就显示一个传统钟表,和菜单里面“不显示秒”等等根本无关。换言之,这完全是另外一个项目;而且有bug(没选择“click through”,不知咋的,钟表就只能“click through”了)。建议另建成一个新的示例,而不要覆盖之前的

官方代码,建议自己fork,在多个平台(例如,虚拟机里跑不同windows、linux版本)实验确定没问题,再申请合并回官方代码

尽管能做贡献的开发人员少,但是也要向着稳定的方向开发啊

retsyo avatar Dec 20 '23 08:12 retsyo

The example of the Chinese calendar still retains a text-only version of the clock in my repositories, where you can go back to normal and use it.

中国日历这个例子,还保留着一个纯文字时钟的版本在我的程序库里,可以去那里恢复正常的来使用

https://github.com/chunmingwang/ChineseCalendar

chunmingwang avatar Dec 20 '23 10:12 chunmingwang

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

I also suggest to modify the code in own fork. Only do pull requests if new code has been tested throughly on different OS, for example different Windows and Linux in a virtualization software.

Although there is not so many coders who can really contribute to this project, I think stability is always a good consideration.

现在的ChineseCalendar一运行就显示一个传统钟表,和菜单里面“不显示秒”等等根本无关。换言之,这完全是另外一个项目;而且有bug(没选择“click through”,不知咋的,钟表就只能“click through”了)。建议另建成一个新的示例,而不要覆盖之前的

官方代码,建议自己fork,在多个平台(例如,虚拟机里跑不同windows、linux版本)实验确定没问题,再申请合并回官方代码

尽管能做贡献的开发人员少,但是也要向着稳定的方向开发啊

You are correct. We need to address the bugs. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples".

hustbeef avatar Dec 20 '23 11:12 hustbeef

Through the development progress of examples, it also helps to promote the progress of mff.

chunmingwang avatar Dec 20 '23 14:12 chunmingwang

You are correct. We need to address the bugs. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples".

You can send a pull request. Only the name of this example should be slightly different.

Through the development progress of examples, it also helps to promote the progress of mff.

You're right.

XusinboyBekchanov avatar Dec 20 '23 17:12 XusinboyBekchanov

The new Transparent mode shows the background. I just tried and got it. The code is still not ready. The logic bothers me a lot. But the new Canvas is drawing smooth and fast, that's the goal. Please try running the example code CanvasDraw.bas and resizing the forms by mouse to improve the code. Everyone could be write code and improve it. That's the best practice.

hustbeef avatar Dec 21 '23 02:12 hustbeef

Fixed: Add Transparent of LED Digital showing (PR #587)

image

hustbeef avatar Dec 21 '23 07:12 hustbeef

Fixed: Add Transparent of LED Digital showing (PR #587)

FX-LED text clock in Example of gdipClock:

image

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

Analog clock in Example of gdipClock:

image

chunmingwang avatar Dec 27 '23 05:12 chunmingwang

Should I submit a PR to restore ChineseCalendar as a pure text clock?

chunmingwang avatar Jan 17 '24 05:01 chunmingwang

Should I submit a PR to restore ChineseCalendar as a pure text clock?

I think it is a good idea

retsyo avatar Jan 17 '24 06:01 retsyo

https://github.com/XusinboyBekchanov/VisualFBEditor/pull/600 Restore ChineseCalendar as a pure text clock Update lunar calender caculate to year 2199

chunmingwang avatar Jan 17 '24 23:01 chunmingwang

Should I submit a PR to restore ChineseCalendar as a pure text clock? Yes. It is OK. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples". And it is can be run under OS Linux also.

hustbeef avatar Jan 18 '24 01:01 hustbeef