XusinboyBekchanov / VisualFBEditor

IDE for FreeBasic
Other
174 stars 39 forks source link

ChineseCalendar shows nothing but black window #583

Open retsyo opened 10 months ago

retsyo commented 10 months ago

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

buggy_clock

chunmingwang commented 10 months ago

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,有空去试试看

retsyo commented 10 months ago

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

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

chunmingwang commented 10 months ago

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

XusinboyBekchanov commented 10 months ago

Yes, after hustbeef's pull request this happened.

After this fix it now shows:

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

hustbeef commented 10 months ago

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 commented 10 months ago

image

XusinboyBekchanov commented 10 months ago

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

hustbeef commented 10 months ago

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.

chunmingwang commented 10 months ago

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.

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

hustbeef commented 10 months ago

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

retsyo commented 10 months ago

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

chunmingwang commented 10 months ago

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

hustbeef commented 10 months ago

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

chunmingwang commented 10 months ago

gdip_click

XusinboyBekchanov commented 10 months ago

A very good example, you can update ChineseCalendar.

chunmingwang commented 10 months ago

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

hustbeef commented 10 months ago

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

chunmingwang commented 10 months ago

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

retsyo commented 10 months ago

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版本)实验确定没问题,再申请合并回官方代码

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

chunmingwang commented 10 months ago

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

hustbeef commented 10 months ago

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\".

chunmingwang commented 10 months ago

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

XusinboyBekchanov commented 10 months ago

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.

hustbeef commented 10 months ago

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 commented 10 months ago

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

image

chunmingwang commented 10 months ago

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 commented 9 months ago

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

retsyo commented 9 months ago

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

I think it is a good idea

chunmingwang commented 9 months ago

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

hustbeef commented 9 months ago

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.

chunmingwang commented 8 months ago

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

I think it is a good idea

i update gdipClock Example, u can try it. leave your message, if u like it or if u have suggestion for it.